Welcome! Log In Create A New Profile

Advanced

Re: Incorrect redirect protocol when behind a reverse proxy

July 25, 2013 10:44AM
On Thu, Jul 25, 2013 at 5:11 AM, Jonathan Matthews
<contact@jpluscplusm.com>wrote:

> What does this mean? Do you see SSL traffic, or do you mean heroku
> terminates the ssl leaving you with http connections only?
>
Heroku handles SSL, and nginx sees only HTTP traffic.

> > 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.
>
I'm not hardcoding anything. Nginx is generating its own redirects. The
case I'm seeing currently is ngx_http_static_module redirecting to add a
trailing slashes to URLs.


> You've gone into the code far too early IMHO. There's usually a way to
> change nginx's behaviour in config.
>
I've gone into the code precisely to find out how to do that, since the
documentation wasn't helping. I was surprised to discover that the
protocol seems to be hardcoded.

> Do all requests have x-f-p? 100%? Then just change your redirects to
> reference it.
>
I don't have any redirects. Nginx is doing this on its own.

--
Glenn Maynard
_______________________________________________
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: 295
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