情况说明
nginx 代理https后,应用redirect https变成http
情况类似
http://2hei.net/mt/2010/02/request-getscheme-cannt-get-https.html
http://yywudi.info/nginx-https-400-bad-request-solution/
原因分析:
浏览器到nginx是https,nginx到应用服务器变成http,
应用服务器,再做302 redirect的时候,返回的redirect 地址就变成了http的地址;
原因是spring mvc的servlet的secheme取值,request.getScheme()
是取请求里的一个scheme值,所有这个值在nginx代理时要设置成https
其中: request.getScheme() return http but not https.
解决方法:
目前是
proxy_redirect http:// $scheme://;
具体说明,还没仔细调查,有时间在细致研究下
参考:
转载自:https://my.oschina.net/greki/blog/168089