https nginx+tomcat+spring boot+shiro https登录跳转http

解决方案:

nginx跳转 443.端口

 proxy_pass http://172.17.243.49:443/star-server/;
 proxy_set_header X-Forwarded-Scheme  $scheme; 
 proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

tomcat server.xml配置

scheme="https" secure="true"最重要提示使用https,要不shiro不生效

 <Connector port="443" protocol="HTTP/1.1"
               connectionTimeout="20000"
               redirectPort="8444"  scheme="https" secure="true"/>

猜你喜欢

转载自blog.csdn.net/zhaofengdeng/article/details/84575772