A question about "proxy_redirect"

speedfirst nginx-forum at nginx.us
Tue Jul 19 05:35:17 UTC 2011


If the backend server uses FULL URL to initiate a redirect, like 

    sendRedirect("http://10.1.2.3:1234/redirect");

Can proxy_redirect match this URL and do the redirect?

I write this in config but it seems doesn't work:

   proxy_redirect http://10.1.2.3.4:1234/redirect
http://$host:$server_port;

but nginx still return "Location: http://10.1.2.3.4:1234/redirect" to
me.

My questions are:
1. Does proxy_redirect  only work in the case of relative URI
redirection?
2. How should I do if I want to convert the backend server's host in the
FULL URL redirection case?

Thanks.

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




More information about the nginx mailing list