• Resolved n00b82

    (@n00b82)


    Hello, I’m not sure if I’m whitelisting the IPs correctly. I tried to follow the tutorial https://blog.nintechnet.com/ninjafirewall-wp-edition-the-htninja-configuration-file/ but I’m not sure if I’m doing it correctly.

    The DreamHost info says the @ record for the site is 64.90.44.245, and that’s automatically whitelisted by the plugin. However, DreamHost also uses IP 64.90.40.105 which is constantly being blocked by the plugin because it’s a bot being blocked access to admin-ajax.php, so it just keeps trying over and over again. I want to block bots, but not from my host.

    This is what I put in the file:
    // Whitelist IPs 64.90.40.105, 3.130.91.167 13.58.237.109, 54.177.225.102, 52.52.119.124, 50.18.64.151, 54.215.174.245, 54.241.116.141, 52.8.69.106, 54.176.188.234, 54.219.154.50, 52.52.7.48, 54.183.112.22, 52.52.136.16, 54.177.8.183, 52.52.37.39, 52.52.93.29, 13.52.116.110:
    // $ip_array = array( ‘1.1.1.1’ , ‘2.2.2.2’ , ‘3.3.3.3’ );
    // if ( in_array( $_SERVER[“REMOTE_ADDR”], $ip_array ) ) {
    // return ‘ALLOW’; // whitelist

    The other IP addresses are for Printful and Printify, which is another issue I’m working on.

    I put the file in /user/.htninja, and the .htninja configuration file is showing up in NinjaFireWall > Dashboard > Optional configuration file, but I’m not sure if I’ve added the IPs correctly because 64.90.40.105 is still getting blocked.

    https://imgur.com/a/Rvb5t9M

    What am I missing? Thank you very much.

Viewing 1 replies (of 1 total)
  • Plugin Author nintechnet

    (@nintechnet)

    It should be:

    <?php
    /*
     +===========================================================================================+
     | NinjaFirewall optional configuration file                                                 |
     |                                                                                           |
     | See: https://blog.nintechnet.com/ninjafirewall-wp-edition-the-htninja-configuration-file/ |
     +===========================================================================================+
    */
    // Whitelist IPs:
    $ip_array = array('64.90.40.105', '3.130.91.167', '13.58.237.109', '54.177.225.102',
       '52.52.119.124', '50.18.64.151', '54.215.174.245', '54.241.116.141', '52.8.69.106',
       '54.176.188.234', '54.219.154.50', '52.52.7.48', '54.183.112.22', '52.52.136.16',
       '54.177.8.183', '52.52.37.39', '52.52.93.29', '13.52.116.110' );
    if ( in_array( $_SERVER['REMOTE_ADDR'], $ip_array ) ) {
     return 'ALLOW'; // whitelist
    }
    
    
Viewing 1 replies (of 1 total)
  • The topic ‘Help whitelisting DreamHost server IP for wp-admin/admin-ajax.php’ is closed to new replies.