Nginx.http强制跳转https

2019-03-12  本文已影响0人  Rainy丶Wang

在server中添加

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

具体案例实现

        server{
                listen    80;
                server_name ***.chumenwai.cn;
                #rewrite ^(.*)$  https://$host$1 permanent;
                location / {
                        proxy_pass http://tomcat_cmzwht;
                        proxy_store off;
                        proxy_redirect off;
                        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                        proxy_set_header X-Real-IP $remote_addr;
                        proxy_set_header Host $http_host;
                        client_max_body_size  100m;
                }
        }

重启Nginx就可以了

上一篇下一篇

猜你喜欢

热点阅读