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

Docker connection mongodb implementation process and code examples

After the container is started Log in to admin fi...

An article teaches you how to use js to achieve the barrage effect

Table of contents Create a new html file: Create ...

MySQL index coverage example analysis

This article describes MySQL index coverage with ...

A brief discussion on the principle of js QR code scanning login

Table of contents The essence of QR code login Un...

Example code of setting label style using CSS selector

CSS Selectors Setting style on the html tag can s...

What are the advantages of using B+ tree index in MySQL?

Before understanding this problem, let's firs...

Explanation of building graph database neo4j in Linux environment

Neo4j (one of the Nosql) is a high-performance gr...

HTML Basics_General Tags, Common Tags and Tables

Part 1 HTML <html> -- start tag <head>...

Reasons for the sudden drop in MySQL performance

Sometimes you may encounter a situation where a S...

Detailed tutorial on building a private Git server on Linux

1. Server setup The remote repository is actually...

JavaScript to implement search data display

This article shares the data display code for Jav...

Centos7 implements sample code for restoring data based on MySQL logs

Introduction Binlog logs, that is, binary log fil...

Running PostgreSQL in Docker and recommending several connection tools

1 Introduction PostgreSQL is a free software obje...