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

    (@nintechnet)

    In the free version, there’s no whitelist, but can can still use the .htninja script for that purpose:

    <?php
    if ( strpos( $_SERVER['REQUEST_URI'], '/wp-json/caos/v1/proxy/stealth' ) === 0 ) {
       return 'ALLOW';
    }

    Thread Starter Ocio132

    (@ocio132)

    for litespeed how should i do it????

    Plugin Author nintechnet

    (@nintechnet)

    Add the code to the .htninja script, it works on Litespeed, Apache and Nginx.

    Thread Starter Ocio132

    (@ocio132)

    One thing if I put the cloudflare thing it won’t let me access the backend

    Plugin Author nintechnet

    (@nintechnet)

    Do you see any error message?

    Thread Starter Ocio132

    (@ocio132)

    if i put this it gives me error 500

    <?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"];
    }
    Plugin Author nintechnet

    (@nintechnet)

    <?php
    
    // 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"];
    }
    // Whitelist '/wp-json/caos/v1/proxy/stealth':
    if ( strpos( $_SERVER['REQUEST_URI'], '/wp-json/caos/v1/proxy/stealth' ) === 0 ) {
       return 'ALLOW';
    }
    
    

    This is the full code to add to your .htninja file.

Viewing 7 replies - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.