The requirements are as follows: There are multiple servers under the domain name. Now we are testing a certain region. Let the IP users in a certain region access only one server and test it separately. If there is no problem, all servers will be updated. If there is a problem, the impact will be small. We will find and solve the problem in time. Solution: Use the nginx module to configure matching rules on the front-end load balancing forwarding machine; In the nginx configuration vhost, add a piece of code to the location section under the domain name If $remote_addr matches the ip, forward it to abc_test_server; server { listen 80; server_name abc.com.cn; access_log /dev/null; error_log /data/logs/error.log; location / { proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; if ($remote_addr ~ "202.96.134.100") { proxy_pass http://abc_test_server; break; } proxy_pass http://abc_server; } } The load balancing configuration also needs to add a section #abc_test only upstream abc_test_server { server 192.168.20.10:80; } #abc.com.cn upstream abc_server { server 192.168.20.11:80; server 192.168.20.12:80; server 192.168.20.13:80; } The set IP will be directly distributed to the backend server 192.168.20.10 for testing; The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM. You may also be interested in:
|
<<: Node+express to achieve paging effect
>>: MySQL Server 8.0.13.0 Installation Tutorial with Pictures and Text
Why do I want to organize the content in this area...
This article example shares the specific code of ...
The test environment of this experiment: Windows ...
First of all, what is 404 and soft 404? 404: Simpl...
Introduction to Swap Swap (i.e. swap partition) i...
The detailed process of configuring the MySQL dat...
Table of contents Preface 1. Download MySQL from ...
The computer system is: win7 This article is main...
Table of contents 1. What is JSON 1.1 Array liter...
This article shares the specific code of making a...
A reader contacted me and asked why there were pr...
This article uses an example to illustrate the pa...
Table of contents 1. Understand the basics 2. Con...
The table caption can be placed above or below th...
1. Text around the image If we use the normal one...