I am running an unsecured ScreenConnect web interface on a machine on my local network. I would like to serve it through port 443 using nginx's reverse proxy, and access it via:
https://<WAN.IP.ADDRESS>/screenconnect
My nginx.conf location block:
location / {
root /www/var/nginx/html
}
location /screenconnect/ {
proxy_pass http://local.screenconnect.server:8040/;
proxy_buffering off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
I am successful in getting to the Screen Connect Web Interface, and the url reads as
https://<WAN.IP.ADDRESS>/screenconnect/
However, any additional subdirectories that I access, such as https://<WAN.IP.ADDRESS>/screenconnect/login.php?
will drop the /screenconnect/
subdirectory and try to access https://<WAN.IP.ADDRESS>/login.php?
This throws me a 404 error.
Things I've tried
- I've inserted
/screenconnect/
tohttps://<WAN.IP.ADDRESS>/login.php?/
and gothttps://<WAN.IP.ADDRESS>/screenconnect/login.php?
, which gives me the site I need. - I've adjusted the web.config file on my screenconnect server and appended the correct directory:
<add key="WebServerAddressableUri" value="https://WAN.IP.ADDRESS:443/screenconnect/" />
- I've tried removing the
/
at the end ofproxy_pass http://local.screenconnect.server:8040/;
andlocation /screenconnect/
- I've also tried a host of different simple directives for the location block from people who have had related problems
- I've replaced the IP of the screenconnect server with an apache server running on port 80 that has a simple html page, which redirects to a subfolder. When redirecting, the /screenconnect/ directory is prepended correctly.