在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;
}
}