简体   繁体   中英

Website is Producing Wrong IP Address

I am working on a WordPress website and have the plugin WP Security installed. It tells me the current IP Address I am on when viewing the website. However the IP address it is producing isn't my correct IP address. I did the same thing on another WordPress website and it did produce the correct IP address.

The reason I'm trying to figure out the IP address is because someone entered their login credentials wrong 5 times. 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. And the IP address it said it was blocking was neither of ours.

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?

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. So it is showing that IP address instead of our current/local IP address.

"All" traffic is routed to your webserver via another server (CDN, Firewall, Nginx etc). Following a failed login attempt the WP plugin is blacklisting this intermediate servers IP address locking everyone out.

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; and the "real visitor" IP may be in HTTP_X_REAL_IP

You can use this script to: check which environment variable on your site contains the actual visitor IP .

It would be useful if you provided the link to the site from which you got the WP Security plugin.

Solution:

Ask your host provider to configure servers so REMOTE_ADDR on your web server will contain visitors IP; or

If you know which environment var is valid (above); then the security plugin may have a setting to configure accordingly; or

Report as a bug on plugins support forum.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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