I've a problem with a redirect http https and using non-www

Can you tell me what is wrong? sometimes i have redirect loop.

server {
        listen 80;
        listen [::1]:80;
        server_name domain.com;
        return 301 https://www.domain.com$request_uri;  
}

server {
        listen 80;
        listen [::1]:80;
        server_name www.domain.com;
        return 301 https://www.domain.com$request_uri;  
}


server {
        listen 443 ssl spdy;
        listen [::1]:443 ssl spdy;
        server_name www.domain.com;
        ......
}

Thanks.

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

_______________________________________________
nginx mailing list
[email protected]
http://mailman.nginx.org/mailman/listinfo/nginx

Reply via email to