简体   繁体   English

网站生产的IP地址错误

[英]Website is Producing Wrong IP Address

I am working on a WordPress website and have the plugin WP Security installed. 我正在WordPress网站上工作,并已安装插件WP Security。 It tells me the current IP Address I am on when viewing the website. 它告诉我查看网站时使用的当前IP地址。 However the IP address it is producing isn't my correct IP address. 但是,它生成的IP地址不是我的正确IP地址。 I did the same thing on another WordPress website and it did produce the correct IP address. 我在另一个WordPress网站上做了同样的事情,它确实产生了正确的IP地址。

The reason I'm trying to figure out the IP address is because someone entered their login credentials wrong 5 times. 我尝试找出IP地址的原因是因为有人错误输入了5次登录凭据。 The website is set up so when that happens it locks that person out of website for an hour. 网站已建立,因此发生这种情况时,该人将被拒登一个小时。 Well when this happened it didn't just block their IP address, but blocked our IP address and the clients IP address. 好吧,发生这种情况时,它不仅封锁了他们的IP地址,而且封锁了我们的IP地址和客户的IP地址。 And the IP address it said it was blocking was neither of ours. 它说被阻止的IP地址也不属于我们。

What could be the reasoning for this single website to be grabbing the incorrect IP address and believing it belongs to us and our client? 这个单一网站获取错误的IP地址并认为它属于我们和我们的客户的原因可能是什么?

EDIT: after looking into it a little more the IP address that is showing up on this website is through Liquid Web, our hosting provider. 编辑:经过更多调查后,显示在该网站上的IP地址是通过我们的托管服务提供商Liquid Web。 So it is showing that IP address instead of our current/local IP address. 因此,它显示的是该IP地址而不是我们当前/本地的IP地址。

"All" traffic is routed to your webserver via another server (CDN, Firewall, Nginx etc). “所有”流量通过另一台服务器(CDN,防火墙,Nginx等)路由到您的Web服务器。 Following a failed login attempt the WP plugin is blacklisting this intermediate servers IP address locking everyone out. 尝试登录失败后,WP插件将该中间服务器的IP地址列入黑名单,从而将所有人拒之门外。

Typically php scripts gets the visitors IP frome the REMOTE_ADDR environment variable: but depending on configuration with eg intermediate Nginx server REMOTE_ADDR may contain the nginx server IP; 通常,PHP脚本从REMOTE_ADDR环境变量获取访问者IP:但是取决于与中间Nginx服务器的配置, REMOTE_ADDR可能包含nginx服务器IP。 and the "real visitor" IP may be in HTTP_X_REAL_IP 并且“真实访客” IP可能在HTTP_X_REAL_IP

You can use this script to: check which environment variable on your site contains the actual visitor IP . 您可以使用此脚本执行以下操作: 检查站点上的哪个环境变量包含实际的访问者IP

It would be useful if you provided the link to the site from which you got the WP Security plugin. 如果您提供了从中获得WP Security插件的站点的链接,这将很有用。

Solution: 解:

Ask your host provider to configure servers so REMOTE_ADDR on your web server will contain visitors IP; 要求您的主机提供商配置服务器,以便Web服务器上的REMOTE_ADDR将包含访问者IP; or 要么

If you know which environment var is valid (above); 如果您知道哪个环境var有效(以上); then the security plugin may have a setting to configure accordingly; 然后该安全插件可能具有相应配置的设置; or 要么

Report as a bug on plugins support forum. 在插件支持论坛上作为错误报告。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM