- 轮询(默认)
upstream pool {
server 192.168.2.130:8000;
server 192.168.2.131:8000;
}
- 权重
upstream pool {
server 192.168.2.130:8000 weight=2;
server 192.168.2.131:8000;
}
- IP绑定
upstream pool {
ip_hash;
server 192.168.2.130:8000;
server 192.168.2.131:8000;
}
- 最少连接优先
upstream pool {
least_conn;
server 192.168.2.130:8000;
server 192.168.2.131:8000;
}
- 响应最快优先(第三方)
upstream pool {
fair;
server 192.168.2.130:8000;
server 192.168.2.131:8000;
}
- url绑定(第三方)
upstream pool {
hash $request_uri;
server 192.168.2.130:8000;
server 192.168.2.131:8000;
}