This article is a mirror article of machine translation, please click here to jump to the original article.

View: 28271|Reply: 6

[Web] Practical combat: nginx reverse proxy ignores the first-layer path

[Copy link]
Posted on 10/15/2021 11:34:06 AM | | | |
Requirements, package all spring modules into one package, because all modules have set the application context root, the request root address of each module is different, if all modules are packaged into one package, the root of all modules will be invalid, as follows:


Since the front-end requests the interface of the back-end module, it will also bring the root of each module, inwithout modifying the front-end codeWe can only solve it through nginx, ignoring the path linking the first layer. As shown in the following figure:



Review:

Use Nginx Reverse Proxy and Content Replacement Module to implement dynamic web content replacement
https://www.itsvse.com/thread-7359-1-1.html

Nginx configuration file multilogical operations
https://www.itsvse.com/thread-9949-1-1.html

Practical configuration of NGINX High Availability Load Balancing
https://www.itsvse.com/thread-9260-1-1.html

Preparation of knowledge

$1,$2,$3 in the nginx configuration

Here's an example to experiment with $1,$2, such as:

At this point, if the access path is localhost:8080/abc/qwe/asd, the browser outputs:

qwe

asd
Start configuring

Based on the above knowledge, nginx is configured as follows:

The test configuration is as follows:

The effect is as follows:



(End)




Previous:Redis will now exit to prevent data corruption. Note that it is...
Next:Docker package conflict issue when installing CentOS 8
Posted on 10/16/2021 12:41:45 AM |
Come and learn to learn...
Posted on 5/25/2022 11:44:08 PM |
Let's learn it too
Posted on 12/20/2022 6:43:55 PM |
Thank you to the owner for sharing selflessly
Posted on 2/22/2023 7:23:15 PM |
sdfsdfsdfsdf
Posted on 2/23/2023 7:07:21 PM |
Learn it
Posted on 2/24/2023 12:33:40 AM |
Learn to learn
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com