A few days ago with the Nginx proxy HTTPS, the application of redirect HTTPS to HTTP, resulting in the Web site can not access the problem, find a half-day on the internet, finally found a solution.
Although I resolved, I believe there are other friends have encountered this problem, so reprint share:
Cause Analysis:
Browser to Nginx is Https,nginx to the application server into HTTP,
Application server, and then do 302 Redirect, the return of the redirect address is good to become the address of HTTP;
The reason is the secheme value of the servlet of spring MVC,request.getscheme ()
is a scheme value in the request, all this value is set to HTTPS when the Nginx proxy
Where: Request.getscheme () return HTTP but not HTTPS.
Workaround:
Change it.
server { listen default_server; Location/{ Proxy_pass http://127.0.0.1:8080; Proxy_redirect/HTTP $scheme://; }}
The above describes the Nginx proxy HTTPS, Spring MVC Web application redirect https into HTTP, including the content, I hope that the PHP tutorial interested in a friend helpful.