upstream backend { ip_hash; session_sticky; server 127.0.0.1:8080; } server { listen 80; server_name localhost; location / { proxy_set_header Host $http_host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_pass http://backend; } }然后在nginx.conf中的http中加入如下的代码
include web.conf;