disable 301 redirect for directory / use relative redirect / change scheme

Etienne Champetier champetier.etienne at gmail.com
Wed Aug 26 16:27:55 UTC 2015


2015-08-26 18:20 GMT+02:00 Edho Arief <me at myconan.net>:

> On Thu, Aug 27, 2015 at 12:52 AM, Etienne Champetier
> <champetier.etienne at gmail.com> wrote:
> >
> >
> > 2015-08-26 17:36 GMT+02:00 Edho Arief <me at myconan.net>:
> >>
> >> On Thu, Aug 27, 2015 at 12:30 AM, Etienne Champetier
> >> <champetier.etienne at gmail.com> wrote:
> >> > Hi,
> >> >
> >> > I have this setup
> >> > browser -> ssl proxy -> nginx
> >> > browser to ssl proxy is https only
> >> > ssl proxy to nginx is http only
> >> >
> >> > now i browse to "https://exemple.com/aaa", where aaa is a directory,
> >> > so nginx send back a 301 redirect with "Location:
> >> > http://exemple.com/aaa/"
> >> >
> >> > Is it possible to send https instead of http (in Location),
> >> > or send a relative header, like "Location: /aaa/",
> >> > or just disable this redirection (in my case it's ok)
> >> >
> >>
> >> see if proxy_redirect[1] fits your need.
> >>
> >> http://nginx.org/r/proxy_redirect
> >>
> > nginx isn't a proxy here, it's a backend (no proxy_pass in my conf)
> > ssl proxy is a black box (not an nginx)
> >
>
> whoops right, sorry.
>
> This seems to work:
>
> if (-d $request_filename) { return 301 https://$host$uri/; }
>

thanks, will try tomorrow


>
> _______________________________________________
> nginx mailing list
> nginx at nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx/attachments/20150826/3febea8b/attachment.html>


More information about the nginx mailing list