公司刚配置的负载均衡,发现不能获取客户端IP了, 获取的都是nginx服务器IP
Google查了下,发现是nginx配置问题
location / { proxy_pass sitename; 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; }
解决!