Nginx配置
user www-data; worker_processes auto; pid /run/nginx.pid; events { use epoll; worker_connections 1024; } http { include mime.types; default_type application/octet-stream; sendfile on; access_log /var/log/nginx/access.log; error_log /var/log/nginx/error.log; keepalive_timeout 65; upstream backend { #ip_hash; server 192.168.0.81:8088; server 192.168.0.96:8089; } server { listen 80; server_name 2; location / { #设置主机头和客户端真实地址,以便服务器获取客户端真实IP proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; #禁用缓存 proxy_buffering off; #反向代理的地址 proxy_pass http://backend; } } }