location /xxx {
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_pass https://xxx.com;
}
这样的话就把ip放在了请求头上 X-real-ip