February 2018
Beginner to intermediate
348 pages
9h 40m
English
Nginx offers several ways to solve the problems we mentioned earlier. The first and simplest of them is the weight flag, which can be enabled in the definition of your server group:
upstream MyUpstream {
server 10.0.0.201 weight=3;
server 10.0.0.202 weight=2;
server 10.0.0.203;
}
By default, servers have a weight of 1, unless you specify otherwise. Such a configuration enables you to give more importance to particular servers: the higher their weight, the more requests they will receive from Nginx. In this example, for every six HTTP requests received, Nginx will systematically distribute:
Read now
Unlock full access