I'm having trouble configuring a web service to run on the root of a domain on Plesk server.
I have a service running on port 2222.
I have the following in the "Additional nginx directives" section on the "Apache and nginx settings" page:
location / {
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://localhost:2222/;
}
Just adding this seems to conflict with the main nginx config (and my service throws a 404 error). In order to get it working correctly, I need to comment out parts of the main config file
# location ~ /$ {
# index "index.html" "index.cgi" "index.pl" "index.php" "index.xhtml" "index.htm" "index.shtml";
#}
This works fine until Plesk updates automatically and overwrites nginx.conf. At which point the site breaks again until I notice and comment the lines out again.
What's the approach I should be using to do this? Plesk must surely support having a domain that is completely powered by a web service?
Thanks,
Dave...
I have a service running on port 2222.
I have the following in the "Additional nginx directives" section on the "Apache and nginx settings" page:
location / {
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://localhost:2222/;
}
Just adding this seems to conflict with the main nginx config (and my service throws a 404 error). In order to get it working correctly, I need to comment out parts of the main config file
# location ~ /$ {
# index "index.html" "index.cgi" "index.pl" "index.php" "index.xhtml" "index.htm" "index.shtml";
#}
This works fine until Plesk updates automatically and overwrites nginx.conf. At which point the site breaks again until I notice and comment the lines out again.
What's the approach I should be using to do this? Plesk must surely support having a domain that is completely powered by a web service?
Thanks,
Dave...