nginx重写常用写法

1、将http协议重写成https协议: (用户用http进行访问,但后端是https),则可添加80 http端口监听,然后进行https rewrite;

     server {
     listen 80;
     server_name    www.xxxxx.com;
     if ($request_uri !~ /(nginx_status|php_status)) {
        rewrite ^/(.*)   https://$server_name/$1  permanent;
   }

2、

posted @ 2018-09-05 14:17  xiao_pai_pai  阅读(297)  评论(0编辑  收藏  举报