1、301永久重定向
2、配置default_server ssl
server {
listen 80;
server_name domain.cn,www.tanqub.com;
return 301 https://www.tanqub.com$request_uri;
}
server {
listen 443;
server_name domain.cn;
return 301 https://www.tanqub.com$request_uri;
}
server {
listen 443 default_server ssl;
server_name www.tanqub.com;
ssl on;
……
}