开发者

request.remote_ip returns wrong ip

I have logging on my website, and i see logs for different people (with different UserAgent strings).

I'm sure, that they have different ip, but all the log records having the same ip.

I use request.remote_ip to store it in DB.

I don't have Apache as front-end. I just have Mongrel.

The question is - Why th开发者_Go百科ey are the same ?


If both users are behind the same proxy server or use the same internet provider, they may appear to have the same IP address. The IP that is seen at the web server is not the IP address of the individual PC, it's the address of the connection being used.


If you are using a load balancer, particularly a non-transparent load balancer, your server will see the IP address of the load balancer. Often times the load balancer will throw the the original remote ip address into a HTTP header.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜