By default the Nginx upstream
directive uses Round-Robin to distribute requests to backend realsevers and set the weight of the server by weight
. But I do not see any words about whether weight works for ip_hash
too.
Some people say weight
does not work with ip_hash
, but I've seen examples of this in too many blogs articles to name.
Questions
- And what about nginx-sticky-module?
- Distribute requests strictly with cookie-sticky and ignore weight, or
weight
DO work for the first time Nginx handles the client's request?
Best Answer
From http://nginx.org/en/docs/http/load_balancing.html
However, with 1.8 it does not work well for me, at least not when user accesses different domains over the same upstream.