Quantcast
Channel: WordPress.org Forums » All Topics
Viewing all articles
Browse latest Browse all 67836

Detect IP issues

$
0
0

Replies: 0

Hey there.

My client using last version of the premium plugin (I can provide key if it needed) and google cloud compute engine with follow structure:

Load Balancer -> Nginx -> Varnish -> Apache.

As you know, when we are using Load Balancer or other proxy server we can catch IP correctly only via X-Forwarded-For because in REMOTE_ADDR you will see local ip. So, if we are follow here: https://cloud.google.com/compute/docs/load-balancing/http/ we will see that the google cloud load balancers sending correct client ip in X-Forwarded-For and I seee this ip in X-Forwarded-For in PHP like this: 99.99.99.99, 130.211.3.4, 130.211.1.2, 127.0.0.1 where 99.99.99.99 is a client ip and 130.211.0.0/22 – is load balancer and server ip.

So, as I see in method getCleanIPAndServerVar (wfUtils.php) I see correct logic and it’s reversing string correctly, but also as I see it’s trying to check that the IP is private, but not trying to check that the IP is whitelisted by user.

Any chance to add this ability to skip server’s IP addresses in this method? Also I think it will be best if I’ll can skip here whitelisted IP addresses in any case. Or maybe just add new method where user can set server IP addresses which will not use to detect user ip address.

Thanks.


Viewing all articles
Browse latest Browse all 67836

Trending Articles