• Resolved eddyferns

    (@eddyferns)


    Hi,

    Message on the Dashboard states:

    You have a private IP : 127.0.0.1
    If your site is behind a reverse proxy or a load balancer, ensure that you have setup your HTTP server or PHP to forward the correct visitor IP, otherwise use the NinjaFirewall .htninja configuration file.

    Have setup Apache with Nginx as the Reverse Proxy and HTTP/2 implemented.

    Not clear about the message and where to setup to forward the correct visitor IP.

    Regards,
    Ed

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

    (@nintechnet)

    You need to use the .htninja.
    This kind of code should work:

    <?php
    /*
     +===========================================================================================+
     | NinjaFirewall optional configuration file                                                 |
     |                                                                                           |
     | See: https://blog.nintechnet.com/ninjafirewall-wp-edition-the-htninja-configuration-file/ |
     +===========================================================================================+
    */
    
    // Reverse proxy:
    if (! empty($_SERVER['HTTP_X_FORWARDED_FOR']) &&
     filter_var($_SERVER['HTTP_X_FORWARDED_FOR'], FILTER_VALIDATE_IP) ) {
    	$_SERVER['REMOTE_ADDR'] = $_SERVER['HTTP_X_FORWARDED_FOR'];
    }
    

    I will add this example to the blog article.

    Thread Starter eddyferns

    (@eddyferns)

    Thanks!

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