如果后端的机器有多台
upstream bbb { server 1.2.3.1:80; server 1.2.3.4:80; } server { listen 80; server_name bbb.com; location / { proxy_pass http://bbb/; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } # access_log /home/logs/bb_access.log combined; }