Redirect problem

Kurogane nginx-forum at nginx.us
Sat Jan 24 05:07:22 UTC 2015


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



More information about the nginx mailing list