nginx集群

http{
    ......
    upstream name001{
        ip_hash;  //
        server 127.0.0.1:9001;
        server 127.0.0.1:9002;
        ......
    }
    server{
    ......
        location /api {
            proxy_set_header X-Real-IP $remote_addr;
            proxy_pass http://name001/;
        }
    }
}

你可能感兴趣的:(nginx集群)