如果nginx不做特殊处理,那么后端获取到的IP总是代理服务器的IP,可以修改conf文件,通过下面方法解决:
location / {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host baidu.com;
proxy_pass https://baidu.com$request_uri;
}如果nginx不做特殊处理,那么后端获取到的IP总是代理服务器的IP,可以修改conf文件,通过下面方法解决:
location / {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host baidu.com;
proxy_pass https://baidu.com$request_uri;
}