- 博客(1)
- 收藏
- 关注
原创 nginx中设置http重定向https
首先打开nginx的设定$ sudo vim /etc/nginx/nginx.conf添加如下设置,监听80端口并把请求重定向到https.server {listen 80 default;server_name www.example.com;return 301 https://$host$request_uri;}然后重启nginx$ sudo service nginx restart这时还有一个问题,我们发现https请求也被重定向到https里了,就这样一直循环然后
2021-06-16 10:13:41
527
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人