https redirect going to infinite loop

parulsood85 nginx-forum at
Fri Jul 12 09:08:45 UTC 2013

Hello Francis,

Here is the curl o/p executed from browser machine.

c:\curl>curl.exe -i
HTTP/1.1 301 Moved Permanently
Content-Type: text/html
Date: Fri, 12 Jul 2013 08:53:12 GMT
Server: nginx/1.2.8
Content-Length: 184
Connection: keep-alive

<head><title>301 Moved Permanently</title></head>
<body bgcolor="white">
<center><h1>301 Moved Permanently</h1></center>

However I noticed that when I put a https redirect like below, it works

rewrite ^/test$ permanent;

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

>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.

I'll work on this, I think this option should work fine.

Thanks for the help.

Parul Sood

Posted at Nginx Forum:,240755,240775#msg-240775

More information about the nginx mailing list