Support for relative URL in Location header

Maxim Dounin mdounin at
Tue Nov 5 16:53:56 UTC 2013


On Tue, Nov 05, 2013 at 08:30:42AM -0800, Jeroen Ooms wrote:

> On Mon, Nov 4, 2013 at 5:08 PM, Maxim Dounin <mdounin at> wrote:
> > The proxy_redirect directive does string replacement, not URI
> > mapping.  If you want it to replace "/two/" with "/one/", you can
> > configure it to do so.  It's just not something it does by
> > default.
> Exactly. I was trying to argue that it probably should do this by
> default, otherwise it leads to behavior that is incorrect in light of
> the revised interpretation of the Location header.

It does exactly what's advertised, so I don't think it's incorrect 
in any light.

It might be more convenient to have it to replace "/two/" with 
"/one/" by default, but given the number of various relative URI 
forms (e.g., consider "//upstream:port/two/"), I don't think it's 
feasible without changing proxy_redirect to actually do URI 
mapping instead of string replacement.

Maxim Dounin

More information about the nginx mailing list