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

Ruslan Ermilov ru at nginx.com
Thu Dec 22 15:06:55 UTC 2016

On Wed, Aug 26, 2015 at 05:30:37PM +0200, Etienne Champetier 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)

JFYI, we've just implemented relative redirects support:

It'll be available in the upcoming 1.11.8 release.  Its use
is controlled by the new directive "absolute_redirect".

Stay tuned.

More information about the nginx mailing list