A question about "proxy_redirect"

speedfirst nginx-forum at nginx.us
Tue Jul 19 05:48:53 UTC 2011


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?

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,212588,212591#msg-212591




More information about the nginx mailing list