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