Pierre-Lannoy / wp-ip-locator

Country and language IP-based detection for WordPress.
https://perfops.one/
GNU General Public License v3.0
6 stars 2 forks source link

IP Location Detects wrong with cloudflare proxy #3

Open huyhoang8398 opened 8 months ago

huyhoang8398 commented 8 months ago

Describe the bug Sometime I notice that the plugin only use the reverse proxy IP instead of client IP when Im using Cloudflare reverse proxy

To Reproduce Steps to reproduce the behavior:

  1. Enable Cloudflare proxy

Expected behavior Detect source IP instead

Screenshots If applicable, add screenshots to help explain your problem.

Environment (please complete the following information):

Pierre-Lannoy commented 8 months ago

Hello thanks for the report.

Could you confirm this behavior is reproducible when you uncheck "Ignore HTTP header" plugin option?

huyhoang8398 commented 8 months ago

Hi @Pierre-Lannoy

Yes, I already disabled that, the issue persists

image

Pierre-Lannoy commented 8 months ago

That's a first from my side… Is Cloudflare IP geolocation correctly activated? (https://developers.cloudflare.com/network/ip-geolocation/)

huyhoang8398 commented 8 months ago

yes, i already enabled that. It strange because sometime it detects wrong even with the same client source IP, i noticed also Wordfence WordPress also sometime detects wrong, so I dont know what I should check/config

Pierre-Lannoy commented 6 months ago

Hello @huyhoang8398 ! Did you find what was going wrong with the headers sent by Cloudflare?