nginx真实ip头获取
server{
server_name api.yysc.online;
listen 80;
client_max_body_size 20m;
location / {
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;
#support websocket
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Origin "*";
proxy_pass http://127.0.0.1:8080;
}
}