本文共 294 字,大约阅读时间需要 1 分钟。
在配置文件中加入下面代码
server {
...
if ($server_port = 80){
return 301 https://$server_name$request_uri;}
if ($scheme = http){
return 301 https://$server_name$request_uri;}
error_page 497 https://$server_name$request_uri;
....
}
本文转自无形于有形 51CTO博客,原文链接:,http://blog.51cto.com/jinchuang/1897391如需转载请自行联系原作者