“After you’ve ensured your web application is setup for a distributed environment, you can then decide on a strategy for load balancing. Nginx offers these strategies:
- Round Robin – Nginx switches which server to fulfill the request in order they are defined
- Least Connections – Request is assigned to the server with the least connections (and presumably the lowest load)
- Ip-Hash/Sticky Sessions – The Client’s IP address is hashed. Ther resulting hash is used to determine which server to send the request to. This also makes user sessions “sticky”. Subsequent requests from a specific user always get routed to the same server. This is one way to get around the issue of user sessions behaving as expected in a distributed environment.
- Weight – With any of the above strategies, you can assign weights to a server. Heavier-weighted servers are more likely to be selected to server a request. This is good if you want to use a partiuclarly powerful server more, or perhaps to use a server with newer or experimental specs/software installed less…”
https://serversforhackers.com/using-nginx-as-a-load-balancer
