Support for relative URL in Location header
mdounin at mdounin.ru
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 mdounin.ru> 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.
More information about the nginx