Spring Boot redirect 域名/HTTPS/HTTP跳转问题解决
问题描述
之前使用shiro时候遇到没有登录HTTPS被跳转到了HTTP,导致使用问题。之前通过nginx方式解决,参考:Shiro Https 跳转Http问题解决-XQLEE'Blog
本次有遇到问题,多层nginx代理(2层)
- 第一层 nginx代理 blog.example.com -> code.example2.com
- 第二层 nginx代理 code.example2.com -> 192.168.1.12:8080
怎么配置redirect:/a 都会跳转到 code.example2.com/a。与预期跳转blog.example.com/a不符合
目标

跳转未带域名+端口+协议的Location
问题排查和解决
首先确认,spring boot使用的是内嵌tomcat,所以根据代码排查
以此搞定所有spring boot重定向乱跑问题
https://www.syntaxspace.com/article/2504211940312751.html
评论