I am using nginx to proxy pass to a NodeJS application. I'm trying to make the URL https://example.com
proxy pass the request to http://example.com:8080/?
Requests (from a mobile app) are requesting https://example.com//
which nginx is making http://example.com:8080//?
which is not working.
Things I have tried which haven't worked:
merge_slashes on;
(which is on by default)rewrite ^/(.*)/$ /$1 permanent;
port_in_redirect off;
My nginx config:
location = /a {
proxy_pass http://127.0.0.1:8080;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Real-IP $remote_addr;
proxy_read_timeout 300;
}
location ^~ /a/ {
proxy_pass http://127.0.0.1:8080;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Real-IP $remote_addr;
proxy_read_timeout 300;
}