nginx 80端口强制转443
server {
listen 80;
server_name test.com;
rewrite ^(.*)$ https://${server_name}$1 permanent;
}
server {
listen 443 ssl;
server_name test.com;
}
location / {
rewrite ^ https://\(server_name\)request_uri? permanent;
}
本文来自博客园,作者:武兴旺,转载请注明原文链接:https://www.cnblogs.com/wuxingwang/p/14436751.html