# 配置上游服务器网关端口集群,默认轮询机制 upstream backServer{ server 127.0.0.1:7001 weight=1; server 127.0.0.1:7002 weight=1; server 127.0.0.1:7003 weight=1; } server { listen 80; server_name nginxtest.com; #charset koi8-r; #access_log logs/host.access.log main; location / { ### 指定上游服务器负载均衡服务器 proxy_pass http://backServer/; index index.html index.htm; }