Problem with SSL

Kurogane nginx-forum at forum.nginx.org
Thu Sep 8 03:58:57 UTC 2016


Domain 1

server {
        listen 80;
        server_name domain1.com;
       	return 301 $scheme://www.$host$request_uri;	
}

server {
	listen 80;
	server_name www.domain1.com;
        root  /home/domain1/public_html;
        ...
}

Domain 2 (SSL)

server {
        listen 80;
        server_name domain2.com;
	return 301 $scheme://www.$host$request_uri;	
}

server {
        listen 80;
        server_name www.domain2.com;
	return 301 https://$host$request_uri;	
}

server {
	listen 443 ssl http2;
	server_name www.domain2.com;

	ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
	ssl_certificate      /home/nginx/ssl/domain2.com/domain2.com.crt;
	ssl_certificate_key  /home/nginx/ssl/domain2.com/domain2.com.key;
        root  /home/domain2/public_html;
        ...
}

Posted at Nginx Forum: https://forum.nginx.org/read.php?2,269401,269417#msg-269417



More information about the nginx mailing list