nginx反向代理配置时,通常会添加下面的配置:nginx
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header REMOTE-HOST $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;网站
location / {spa
proxy_pass http://127.0.0.1:10678;代理
proxy_set_header Host $host;ip
proxy_set_header X-Real-IP $remote_addr;rem
proxy_set_header REMOTE-HOST $remote_addr;it
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}io
这样就ok了。反向代理