nginx 负载均衡
# weight=3 权重
# backup 备用服务,不参与负载,除非其他的宕机
upstream tomcat_server{
server 127.0.0.1:8080 weight=3;
server 127.0.0.1:8081 weight=1;
}
server {
listen 80;
server_name 192.168.174.129;
location / {
# proxy_pass http://127.0.0.1:8080;
proxy_pass http://tomcat_server;
include proxy.conf;
}
}