I simply did a load balancing setting when I was working, and it felt pretty dry, so let’s share it.
Hope the great god will guide me.
Step 1: Need to download nginx
download address: http://nginx.org/en/download.html
I use this version.
After the download is complete, the windows system only needs the next step and install it in your favorite disk.
Part 2: Understand about nginx to
open the installed folder
The third part: learn about the reverse proxy
proxy server of nginx , such as: www.xiaolu.com jump directly to 127.0.0.1:8080 to
be a reverse proxy configuration:
In the picture, I listened to port 8080, domain name: localhost, and the redirected address was 127.0.0.1:8090 to
locate the root directory of nginx, and execute the command: nginx.exe to
locate the 8090 website configured in my IIS. This is nginx Reverse proxy.
The fourth step: understand what is load balancing
My understanding is: the carrying capacity of a server is limited. When the server is accessed by a large number of users at the same time, the server will be overloaded.
For example, in a traffic jam on a highway, the rush hour is beyond expectations. So if there are two highways leading to a destination, it will definitely be much more comfortable.
Load balancing roughly means this. The function of nginx is to load two different servers through the reverse proxy domain name.
Step 5: nginx load balancing configuration
The above figure directly
specifies the polling probability, and the weight is proportional to the access ratio, which is used when the back-end server performance is uneven.
If the back-end server is down, it can be automatically removed.
For example, in the following configuration, the access volume of the 91 server is twice that of the 90 server.
I will explain so much this time, and I will continue to write more questions next time.