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';
}
for litespeed how should i do it????
Add the code to the .htninja script, it works on Litespeed, Apache and Nginx.
One thing if I put the cloudflare thing it won’t let me access the backend
Do you see any error message?
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"];
}
<?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.