基于协议判断并跳转
if ($scheme = http ) {
return 301 https://$host$request_uri;
}
基于端口判断并跳转
if ($server_port = 80 ) {
return 301 https://$host$request_uri;
}
if ($scheme = http ) {
return 301 https://$host$request_uri;
}
if ($server_port = 80 ) {
return 301 https://$host$request_uri;
}
评论区