Is the Nginx's load balancing policy customizable in any way? Having two sites A and B I want 20% of all the requests to go to A and the rest to B. Is that possible/feasible? Is there a better solution out there for this task?
Thanks,
Alex
|
Is the Nginx's load balancing policy customizable in any way? Having two sites A and B I want 20% of all the requests to go to A and the rest to B. Is that possible/feasible? Is there a better solution out there for this task? Thanks, Alex | |||
|
feedback
|
|
In your upstream block you can adjust the weights like this:
For every 10 requests, it will send 2 to 1.11, and 8 to 1.12, about an 20%/80% divide. There are a bunch of options like to set an idle spare, and load balancing by source IP address. See the docs for more details about the upstream parameter. | |||||||
feedback
|