1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
| upstream webservers{ server 192.168.131.1:8080 weight=90 ; # 服务器"1"的权重为90,"2"权重为10, 则接近90%的资源访问由服务器"1"处理 server 192.168.131.2:8080 weight=10 ; }
server { listen 80; server_name localhost;
# 反向代理,处理管理端发送的请求 location /api/ { proxy_pass http://webservers/admin/; }
}
|