Welcome! Log In Create A New Profile

Advanced

Re: Incorrect redirect protocol when behind a reverse proxy

Jonathan Matthews
July 25, 2013 06:12AM
On 24 Jul 2013 23:03, "Glenn Maynard" <glenn@zewt.org> wrote:
>
> Our nginx server is running on Heroku, which proxies SSL.

What does this mean? Do you see SSL traffic, or do you mean heroku
terminates the ssl leaving you with http connections only?

> This mostly works fine, but nginx has one problem with it: since it
thinks the protocol is http, any redirects (such as trailing-slash
redirects) go to http instead of https.

Show us some config that generates these redirects.

> The usual fix for this is X-Forwarded-Proto, but nginx doesn't support
that yet

That doesn't make sense to me. What is there to support? You can just write
your redirect directives using X-F-P instead of hard coding the scheme.

> and I haven't found any way to configure it, eg. a configuration
directive to override the protocol.
> Nginx seems to decide whether redirects should go to http or https
entirely based on whether the connection has an SSL context associated
(ngx_http_header_filter), so it doesn't look like there's any way to affect
this in configuration.

You've gone into the code far too early IMHO. There's usually a way to
change nginx's behaviour in config.
>
> Is there any workaround?

Do all requests have x-f-p? 100%? Then just change your redirects to
reference it.

J
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Incorrect redirect protocol when behind a reverse proxy

glenn July 24, 2013 06:04PM

Re: Incorrect redirect protocol when behind a reverse proxy

Jonathan Matthews July 25, 2013 06:12AM

Re: Incorrect redirect protocol when behind a reverse proxy

glenn July 25, 2013 10:44AM

Re: Incorrect redirect protocol when behind a reverse proxy

Jonathan Matthews July 25, 2013 11:54AM

Re: Incorrect redirect protocol when behind a reverse proxy

glenn July 25, 2013 12:16PM

Re: Incorrect redirect protocol when behind a reverse proxy

Jonathan Matthews July 25, 2013 02:42PM

Re: Incorrect redirect protocol when behind a reverse proxy

glenn July 30, 2013 05:28PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 280
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready