天天看点

Nginx服务器http重定向到https

Nginx服务器http重定向到https

server {    

          listen       80;    

          server_name  test-ftqc.navinfo.com;    

          rewrite ^(.*)$ https://$server_name$1 permanent;    

         }

或者

          rewrite  ^  https://$server_name$request_uri? permanent;    

现在nginx新版本已经换了种写法,上面这些已经不再推荐。

下面是nginx http页面重定向到https页面最新支持的写法:

继续阅读