http协议重定向到https协议 nginx配置 nginx配置 server { listen 80; server_name domain.com; location / { return 301 https://$server_name$request_uri;#强制重定向到https协议 } } server { listen 443 ssl; server_name domain.com; }