nginx install ssl and reverse proxy tomcat

1.nginx configure ssl

1. Apply for ssl certificate:

Please go to "Alibaba Cloud to apply for Symantec Free SSL Certificate Operation Process":
http://www.chinaz.com/web/2017/0105/639110.shtml
After the application is submitted, it can be approved within one day.

2. Install the certificate:

a) After downloading and decompressing, you will get two files:

 
  The key file is the private key, and pem is the public key

 

b) Import the certificate into the nginx server

 

i. Find the nginx.conf file in the installation directory and add the following content:

 Pay attention to the location of the file in the red box.


ii. Create a cert folder in the same directory as the nginx.conf file, put the key and pem files in it, restart the ng service (restart command: ./nginx -s reload), and run it successfully.

 

3. Verify that ssl is installed successfully

a) Since it is verified on the local area network, the local area network address of the ng server is 192.168.1.97, so modify the router host file, use extreme routing, download the relevant plug-in "custom hosts", and add the configuration information as follows:

 b) Enter ssl in the browser The associated domain name to see if it can jump to the static page index.html of the nginx server

Installation was successful cool!

 

2. Reverse proxy two Tomcat services

1. Run two tomcat configurations locally as follows:

  Tomcat1: 192.168.1.247:8088
  Tomcat2: 192.168.1.247:8089
  Running two identical projects: Myproject01

2.nginx server:

  IP: 192.168.1.97


3. The Nginx configuration file is modified as follows:

 

4. The calling sequence is as follows:


 

5. Use WireShark to view port transmission data 

    a) Simple form submission

 


 b) Port detection data

 

Through the detection, I saw an unencrypted information. The corresponding process is the process of tomcat returning data to nginx , which belongs to the internal transmission of the server, and other data are encrypted by ssl.

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326337234&siteId=291194637