Nginx behind HAProxy
HAProxy and Nginx on same host are all fun and games. The first one listens on port 443, and the second one on 444, configured as proxy’s backend. Everything works, we go home, right? wrong If you happen to run nginx on a different port on a same host, the folder redirects won’t work properly, as nginx will HTTP/301 the living hell to the proper fully-fledged absolute-path URI, and not relative path. (i.e. https://example.com/folder goes to HTTP/301 https://example.com/folder/ and not HTTP/301 ./folder/). ...