• Resolved neoxyn

    (@neoxyn)


    Hey guys!

    First of all thank you for this awesome plugin.

    Recently I connected my website to cloudflare and today I recognised the “HTTP_CF_CONNECTING_IP” message.

    I followed your guide and uploaded the htninja on my server. In the Dashboard I see that the plugin finds the file, however it still shows the HTTP_CF_CONNECTING_IP message.

    So I m not sure, if everything is working fine… In the htninja file I just deleted the Incapsula CDN service coding. Do I have to do anything else?

    Thank you in advance for your help.

    Best Regards
    Neoxyn

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author nintechnet

    (@nintechnet)

    If the file appears to be loaded but it doesn’t work as expected, the code is likely wrong. This is what you should have in the .htninja when using cloudflare:

    <?php
    /*
     +===========================================================================================+
     | NinjaFirewall optional configuration file                                                 |
     |                                                                                           |
     | See: https://blog.nintechnet.com/ninjafirewall-wp-edition-the-htninja-configuration-file/ |
     +===========================================================================================+
    */
    
    // Users of Cloudflare CDN:
    if (! empty($_SERVER["HTTP_CF_CONNECTING_IP"]) &&
     filter_var($_SERVER["HTTP_CF_CONNECTING_IP"],FILTER_VALIDATE_IP)) {
       $_SERVER["REMOTE_ADDR"] = $_SERVER["HTTP_CF_CONNECTING_IP"];
    }
    
    Thread Starter neoxyn

    (@neoxyn)

    Hey,

    with the new code it works. Thank you very much!

    Have a nice day!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘HTTP_CF_CONNECTING_IP’ is closed to new replies.