• Resolved danz

    (@dafl)


    I’ve started using Amazon CloudFront on my site, and I think since then, targeting countries with GeoTargeting Lite does not work anymore. I saw that there is support for Cloudflare, but I wonder if CloudFront is also supported? Could this be the problem of the plugin no longer showing content for visitors from certain countries?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Damian

    (@timersys)

    Could you share debug data page?

    Thread Starter danz

    (@dafl)

    OK, I just activated Debug Mode and I am getting the server IP, not my own:

    <!-- Geotargeting plugin Debug Info START-->
    		<div id="geot-debug-info" style="display: none;"><!--
    		Country: United States of America
    		Country code: US
    		IP: , 52.56.127.**
    		Geot Version: 1.3.2
    		PHP Version: 5.6.36
    		-->
    		</div>
    <!-- Geotargeting plugin Debug Info END-->

    By debug page, do you mean “Ip Test page”?
    The most correct info on this page is:

    Clouways
    $_SERVER[HTTP_X_FORWARDED_FOR] = 213.89.**.**, 52.56.127.**

    213… is correctly identified as my IP, and 52… is the server IP.

    Is there now any way for the plugin to use the first Cloudways (sic) IP for geotargeting?

    Thanks so much!

    Plugin Author Damian

    (@timersys)

    Hi,
    add the following in your functions.php

    add_filter('geot/user_ip', function($ip) {
    $ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
    return strstr( $ip, ',') === false ? $ip : strstr( $ip, ',', true);
    });
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Does GeoTargeting support Amazon CloudFront?’ is closed to new replies.