• Resolved Andrey

    (@andr3y1p)


    Hello! Please tell me how to do it?

    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.

    I use the proxy to Varnish

    https://www.ads-software.com/plugins/ninjafirewall/

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

    (@nintechnet)

    Hi,

    As indicated, you can create a ‘.htninja’ file and set it up to forward the correct IP.
    If the user real IP is stored in the ‘HTTP_X_FORWARDED_FOR’ header, then add this code to the .htninja file:

    <?php
    /*
     +=============================================================+
     | NinjaFirewall optional configuration file                   |
     |                                                             |
     | See: https://ninjafirewall.com/wordpress/htninja/            |
     +=============================================================+
    */
    
    if ( isset($_SERVER['HTTP_X_FORWARDED_FOR']) ) {
       $_SERVER["REMOTE_ADDR"] = $_SERVER['HTTP_X_FORWARDED_FOR'];
    }

    Thread Starter Andrey

    (@andr3y1p)

    Thanks a lot, Ninja! It works ??

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘You have a private IP : 127.0.0.1 (forward the correct visitor IP) How?’ is closed to new replies.