xin

Directive reference

upstream

Declares a named pool of backend servers.

Syntaxupstream name { ... }
Contextshttp
Defaultnone

Behavior

Pools support weighted round robin, least_conn, ip_hash, hash and random policies, backup/down servers, passive failure detection and keepalive.

Example

upstream backend {
    least_conn;
    server 10.0.0.10:8080 weight=2;
    server 10.0.0.11:8080;
}

server {
    location / { proxy_pass http://backend; }
}

Related directives

server · proxy_pass