大多数教程都写的是用rewrite301到https,但重写过多,容易陷入死循环。
以下分享一个思路:
1.新建一个空站点。
2.修改nginx conf文件
http80端口监听,error错误写https地址

3.root 地址也改成那个空站点的目录
当我们访问http也就是80端口,并不存在文件,404跳转到https网站。
大多数教程都写的是用rewrite301到https,但重写过多,容易陷入死循环。
以下分享一个思路:
http80端口监听,error错误写https地址
当我们访问http也就是80端口,并不存在文件,404跳转到https网站。
本文标题:nginx 一个小技巧解决http强制转https
本文链接:https://www.haomeiwen.com/subject/jxkefktx.html
网友评论