https redirect going to infinite loop

parulsood85 nginx-forum at nginx.us
Fri Jul 12 06:50:56 UTC 2013


Hello Francis,

Thanks for the quick reponse. Here is the snipet of the config being used

#############################################################################

http {
    include       mime.types;
    default_type  application/octet-stream;

    log_format  main  '$remote_addr - $remote_user [$time_local] "$request"
'
                      '$status $body_bytes_sent "$http_referer" '
                      '"$http_user_agent" "$http_x_forwarded_for"';

    access_log  /app/nginx/logs/access.log main;

        proxy_buffering    off;
        proxy_set_header   X-Real-IP $remote_addr;
        proxy_set_header   X-Scheme $scheme;
        proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header   Host $http_host;

        upstream my-backend {
        server 127.0.0.1:9000;
  }
   
   
   server {
        listen       80;
        server_name  example.com;

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

#############################################################################

the output of curl -i http://example.com

curl: (7) couldn't connect to host 

The loadbalancer is in the different DMZ it will sent the request on port 80
& 443 to nginx server on port 80. The loadbalancer urls are
http://example.com & https://example.com both are working.

Please let me know if any other information is required.


Regards,
Parul Sood

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,240755,240772#msg-240772



More information about the nginx mailing list