nginx load balancing policy configuration url_hash

Reference article:

https://docs.nginx.com/nginx/admin-guide/load-balancer/http-load-balancer/
the path, the hash consistency, specific configuration

upstream backend {
    hash $request_uri consistent;
    server backend1.example.com;
    server backend2.example.com;
}

Note that: the order can not be wrong, otherwise it will error

nginx: [warn] load balancing method redefined in /etc/nginx/conf.d/upstream.conf:5

https://ma.ttias.be/nginx-nginx-warn-load-balancing-method-redefined/

Guess you like

Origin www.cnblogs.com/victor2302/p/11140755.html