D
Deleted member 1066013
Guest
Hey everyone,
I have a few Docker containers running on my cPanel server and recently switched from Engintron to NGINX® Manager.
Using Engintron, I had redirected calls to the subdomains to IP:port of the Docker containers.
I achieved this with this code in CustomRules.conf:
I wanted to configure the reverse proxy via the include files in /etc/nginx/conf.d/users/user/sub#.domain.com/sub.conf .
Unfortunately I found out that neither if-blocks nor proxypass are allowed here.
How can I make the call to my subdomain be redirected to my docker container?
Thanks for your help
I have a few Docker containers running on my cPanel server and recently switched from Engintron to NGINX® Manager.
Using Engintron, I had redirected calls to the subdomains to IP:port of the Docker containers.
I achieved this with this code in CustomRules.conf:
NGINX:
#Redirect http to https
if ($scheme = "http") {
set $redirToSSL "yes";
}
if ($host ~* "^sub1\.|^sub2\.") {
set $shouldSSL "please";
}
set $sslRedirection $redirToSSL$shouldSSL;
if ($sslRedirection = "yesplease") {
return 301 https://$host$request_uri;
}
#Redirect Subdomain to Docker
if ($host = "sub1.domain.com") {
set $PROXY_SCHEME "http"; # Is the internal protocol HTTPS? If not, change to "http"
set $PROXY_DOMAIN_OR_IP "server.domain.com";
set $PROXY_TO_PORT PORT;
set $redirToSSL "on";
}
if ($host = "sub2.domain.com") {
set $PROXY_SCHEME "http"; # Is the internal protocol HTTPS? If not, change to "http"
set $PROXY_DOMAIN_OR_IP "server.domain.com";
set $PROXY_TO_PORT PORT;
set $redirToSSL "on";
}
Unfortunately I found out that neither if-blocks nor proxypass are allowed here.
How can I make the call to my subdomain be redirected to my docker container?
Thanks for your help
Last edited by a moderator: