Problem description: Want to implement https://xxxxxxx access, but always jump http://xxxxxxx, while Nginx and tomcat separate server?
Premise: Have done SSL basic configuration, that is, Nginx made 443LISTEN,ssl_certificate and Ssl_certificate_key, other items and 80LISTEN modules the same.
For Nginx and Tomcat server separation to implement reverse proxy this problem, the following are the following solutions and methods.
Idea: Nginx on do https,tomcat on do http,nginx reverse proxy tomcat8080 port, then the problem is on the port, about SSL, of course, think of is 443 port,
To access the services under Tomcat, the proxy port is the key, i.e. ProxyPort.
Method:
1) nginx configuration file
650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M00/7F/4E/wKiom1cZiOWCFsZyAABc9HD2kos555.png "title=" Clipboard.png "alt=" Wkiom1cziowcfszyaabc9hd2kos555.png "/>
X-forwarded-proto is to correctly identify the actual service is issued by the Protocol is HTTP or HTTPS, for example, it means that all local services are issued by the protocol is HTTPS, then the next
The idea is also clear that the service on Tomcat also accepts HTTPS.
2) Tomcat's server.xml configuration
650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M02/7F/4C/wKioL1cZifaCVQGiAABkOizynNQ298.png "title=" Clipboard1.png "alt=" Wkiol1czifacvqgiaabkoizynnq298.png "/>
ProxyPort Proxy port configuration 443, is to accept from (1) sent from the https premise, of course, if a classmate involved in Redis, also need to change redistport to 443, the same reason. Next is
Valve module, this module can only exist one, think I had 2, this is the tears ah, here for the standard security policy configuration, pay extra attention to the value of Portocolheader, you know what the meaning of the comparison!!! 650) this.width=650; "src=" Http://img.baidu.com/hi/jx2/j_0003.gif "alt=" J_0003.gif "/>
I am the chicken move June, I speak for oneself 650) this.width=650; "src=" Http://img.baidu.com/hi/jx2/j_0084.gif "alt=" J_0084.gif "/>!!!
This article is from the "Chicken Move June" blog, please be sure to keep this source http://ntxjxp.blog.51cto.com/11279216/1766579
Nginx SsL +tomcat for HTTPS