A question about "proxy_redirect"

Igor Sysoev igor at sysoev.ru
Tue Jul 19 06:12:26 UTC 2011


On Tue, Jul 19, 2011 at 01:48:53AM -0400, speedfirst wrote:
> 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?

No. I believe your backend does not send
Location: http://upservers/...
but sends
Location: http://10.1.2.3:1234/...


-- 
Igor Sysoev



More information about the nginx mailing list