- Need to open nginx
- Open tomcat
- 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
At the same time, you also need to modify the hosts file of this machine. The following figure shows the path of this file.
Open with other editing tools and add a line of content
to the file. Go back to the virtual machine and reload nginx to make the nginx.conf file effective.
Use the command line to view Are there any grammatical and other errors
in the configured nginx.conf file
. 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.