Detailed explanation of Nginx reverse proxy example

Detailed explanation of Nginx reverse proxy example

1. Reverse proxy example

1 1. Achieve the effect

(1) Open the browser and enter www.123.com to go to the main page of the Linux system Tomcat.

2. Specific configuration

(1) In the hosts file of Windows system, make the correspondence between domain name and IP

(2) Making requests in Nginx

Notice:

The port is open to the outside world.

2. Reverse Proxy Example

2 1. Achieve results

(1) Use Nginx reverse proxy to jump to services on different ports according to the access path. The Nginx listening port is 8001.

Visit http://127.0.0.1:9001/deu/ and jump directly to 127.0.0.1:8016

Visit http://127.0.0.1:9001/vod/ and jump directly to 127.0.0.1:8021

2. Preparation

(1) Prepare two Tomcat servers, one with port 8080 and the other with port 8081.

(2) Create folders and test pages

(3) Enter the configuration file and modify the port number of Tomocat

(4) Modify the port number

(5) Perform a test to see if it is successful

(6) Configure the second Tomcat

3. Specific configuration

(1) Find the specific configuration file of Nginx

The listening port number is 9001. If the path contains edu, it will go to 8016.

4. Open external port number: 9001

5. Restart Nginx

6. Final test

This is the end of this article about the detailed explanation of Nginx reverse proxy example. For more relevant Nginx reverse proxy content, please search for previous articles on 123WORDPRESS.COM or continue to browse the following related articles. I hope everyone will support 123WORDPRESS.COM in the future!

You may also be interested in:
  • Nginx reverse proxy configuration to remove prefix case tutorial
  • Summary of pitfalls of using nginx as a reverse proxy for grpc
  • Full process record of Nginx reverse proxy configuration
  • How to implement Nginx reverse proxy for multiple servers
  • The whole process of configuring reverse proxy locally through nginx
  • Implementation of proxy_pass in nginx reverse proxy
  • How to maintain a long connection when using nginx reverse proxy
  • Nginx reverse proxy to go-fastdfs case explanation

<<:  JavaScript function syntax explained

>>:  MySQL quick recovery solution based on time point

Recommend

An example of implementing a simple finger click animation with CSS3 Animation

This article mainly introduces an example of impl...

Experience in solving tomcat memory overflow problem

Some time ago, I submitted a product version to t...

How to recover accidentally deleted messages files in Linux

If there are files that are being used by a proce...

Toolkit: A more powerful front-end framework than Bootstrap

Note: Currently, the more popular front-end frame...

View MySQL installation information under Linux server

View the installation information of mysql: #ps -...

How to use selenium+testng to realize web automation in docker

Preface After a long time of reading various mate...

The easiest way to make a program run automatically at startup in Linux

I collected a lot of them, but all ended in failu...

How to quickly import data into MySQL

Preface: In daily study and work, we often encoun...

Using CSS to implement loading animation of Android system

There are two common loading icons on the web, on...

Detailed Tutorial on Using xargs Command on Linux

Hello everyone, I am Liang Xu. When using Linux, ...

How to install openjdk in docker and run the jar package

Download image docker pull openjdk Creating a Dat...

Mysql GTID Mha configuration method

Gtid + Mha + Binlog server configuration: 1: Test...

17 JavaScript One-Liners

Table of contents 1. DOM & BOM related 1. Che...