I find that if I uses proxy_pass to an upstream, the FULL URL match will fail:
upstream upservers {
server 10.1.2.3:1234;
}
location / {
proxy_pass http://upservers;
proxy_redirect http://upservers/ http://$host:$server_port;
}
However, if I directly proxy_pass to the backend, it works:
location / {
proxy_pass http://10.1.2.3:1234;
proxy_redirect http://10.1.2.3:1234 http://$host:$server_port;
}
Did I make some mistakes in the upstream config?