Reverse Proxy Issue
-
Hi, I have an issue on my site, the number (german number) is suppose to change to an Austrian number based on the GeoIP detection plugin, this use to work until the hosting was moved to section.io and moved over to HTTPS. I have a developer that sent me an email explaining, I will quote them below, I hope it means more to you than me.
“I think you’re in the right part of the code and going in the right direction but my feel is the plugin isn’t doing the right thing. From the plugin settings page (https://www.intrepidtravel.de/wp-admin/options-general.php?page=geoip-detect%2Fgeoip-detect.php) you can see that it is correctly identifying the x-forwarded-for value (my IP is 139.130.141.122) but even though “The server is behind a reverse proxy” is checked it is displaying 35.189.17.20 IP address (i.e. the without proxy address). That feels like a bug with the plugin in that it isn’t taking the config into account correctly. Further diving into the code if you look at the implementation of geoip_detect2_get_client_ip you can see that the author is taking the rightmost value of the x-forwarded-for value (in this case 172.17.0.1 which is the IP of section.io) which I think is also wrong. I would either fork the plugin and push back or just write my own version of the get client ip function.”
Hope that helps.
Thanks
The page I need help with: [log in to see the link]
The topic ‘Reverse Proxy Issue’ is closed to new replies.