Getting started with nginx reverse proxy

  1. Need to open nginx
    Insert picture description here
  2. Open tomcat
    Insert picture description here
  3. Configure the nginx.conf file of nginx, add these two lines of content in these two positions of the file, the path of this file is vim
    /usr/local/nginx/conf/nginx.conf

Insert picture description here

At the same time, you also need to modify the hosts file of this machine. The following figure shows the path of this file.
Insert picture description here
Open with other editing tools and add a line of content
Insert picture description here
to the file. Go back to the virtual machine and reload nginx to make the nginx.conf file effective.
Insert picture description here
Use the command line to view Are there any grammatical and other errors
Insert picture description here
in the configured nginx.conf file
Insert picture description here
. Just enter the ip of the virtual machine in the browser and see if you can jump to the configured page. This completes the simple case of nginx reverse proxy.

Guess you like

Origin blog.csdn.net/qq_44945599/article/details/109201121