#设定负载均衡服务器列表 engine
upstream nodes1 {
#后端服务器访问规则
ip_hash;
#server 10.1.1.204 weight=1; #server1
server 10.1.1.16:20001 weight=1; #server1
}
server {
listen 20001;
server_name 10.1.1.200;
location / {
proxy_pass http://nodes1 ;
}
}
#设定负载均衡服务器列表 core
upstream nodes2 {
#后端服务器访问规则
ip_hash;
#server 10.1.1.204 weight=1; #server1
server 10.1.1.16:20002 weight=1; #server1
}
server {
listen 20002;
server_name 10.1.1.200;
location / {
proxy_pass http://nodes2 ;
}
}
网友评论