Welcome! Log In Create A New Profile

Advanced

Re: https redirect going to infinite loop

Francis Daly
July 12, 2013 04:12AM
On Fri, Jul 12, 2013 at 02:50:56AM -0400, parulsood85 wrote:

Hi there,

> server {
> listen 80;
> server_name example.com;

So: nginx is not listening for https requests?

> location / {
> rewrite ^(.*) https://example.com permanent;
> proxy_pass http://my-backend;

Aside: It is unlikely that both of these lines do something useful.

> the output of curl -i http://example.com
>
> curl: (7) couldn't connect to host

And the http server isn't listening at all? Or maybe your routing or
other proxying is broken -- this command should be run from the same
machine that a browser is on that sees the failure. The aim is to see
the exact response which leads to the failure. But it may not matter,
see below.

> The loadbalancer is in the different DMZ it will sent the request on port 80
> & 443 to nginx server on port 80.

So: the loadbalancer listens for http and https, and sends both requests
to nginx as http?

Which means nginx can't tell whether the initial request was http or https?

Do the http-to-https redirect on the load balancer, which knows whether
the initial request was http or https.

Or configure the load balancer to give a clue to nginx whether the
initial request was http or https, and configure your nginx to respond
to that clue.

f
--
Francis Daly francis@daoine.org

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

https redirect going to infinite loop

parulsood85 July 11, 2013 07:27AM

Re: https redirect going to infinite loop

Francis Daly July 11, 2013 06:16PM

Re: https redirect going to infinite loop

parulsood85 July 12, 2013 02:50AM

Re: https redirect going to infinite loop

parulsood85 July 12, 2013 02:50AM

Re: https redirect going to infinite loop

Francis Daly July 12, 2013 04:12AM

Re: https redirect going to infinite loop

parulsood85 July 12, 2013 05:08AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 168
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