listen proxy_protocol and rewrite redirect scheme

Francis Daly francis at
Sat Sep 17 12:10:31 UTC 2016

On Sat, Sep 17, 2016 at 02:36:31AM -0400, adrhc wrote:

Hi there,

> yep, that's exactly my problem:
> "... but that will not help internally-generated things like the
> trailing-slash redirect for directories."
> I'll check your solution though I'm very open for other too :D

If you care only about the internally-generated trailing-slash redirects,
then you could try to add something like (lifted from a parallel thread)

  if (-d $request_filename) {
    rewrite [^/]$ https://$host$uri/ permanent;

into places where the trailing-slash redirect might happen.

If there are any other http-not-https redirections that you see, possibly
they could be investigated as they arise.

At least, that would avoid you patching the source.


Francis Daly        francis at

More information about the nginx mailing list