I have haproxy which listening on ports 80 and 443 and behind Nginx listening locally on ports 8000, 8001, 8002 etc...
By default, all works fine but when an application web made a redirect 301, it redirect with the local port in the response so my firewall drop this when I try to access in the web site.
If I go on the specific URL, the server send me a bad redirection 301 because in the location header, there is the local port.
How say to Haproxy or Nginx do not add local port in location header?
Thanks in advance
PS: My configuration is full https. All websites run on port 443.
http-response set-header Location ...
orrspirep ^Location: ...
, but as @Tim suggests, you'd be better-served by configuring the application itself to return correct redirects.proxy_redirect http://example.lan:8000/(.*) https://example.lan/$1;
but the header location stay the same. So, the proxy_redirect must be in location /.. or in server block? Because I have other locations block.