I'm trying to implement a reverse proxy with nginx. But with the configuration above what I get is a wrong url in the browser:
http://domain:9080/myLocation/something.html
and what I need is (with no port):
http://domain/myLocation/something.html
Configuration:
location /myLocation {
proxy_set_header Host $host:$server_port;
proxy_set_header X-Real-IP $remote_addr;
proxy_pass http://xptoserver:9080$request_uri;
}
Host header should never have a port in it.
Change this:
To this: