The syntax is correct and it worked when I tested it. Did you check in the “NinjaFirewall > Dashboard” page if the .htninja script is loaded by the firewall?

Thread Starter
dimsal
(@dimsal)
Yes, the .htninja file is loaded by the firewall.
One other weird thing is in Advanced tab of Firewall Policies I have Set Content-Security-Policy for the website frontend enabled and the rules are not getting updated. I’ve added new rules but the browser’s Developer Console still shows old outdated version of the rules. I checked all the caching, etc. and can’t find the reason why would it show the old version. Any ideas what else to check?
Can you run the troubleshooter script and paste the results here: https://nintechnet.com/share/wp-check.txt
1. Rename it to “wp-check.php”.
2. Upload it into your WordPress root folder.
3. Go to http://YOUR WEBSITE/wp-check.php
4. Delete it afterwards.
Thread Starter
dimsal
(@dimsal)
Here’s the result:
NinjaFirewall (WP edition) troubleshooter
HTTP server : nginx/1.19.3
PHP version : 7.4.24
PHP SAPI : FPM-FCGI
auto_prepend_file : /home/******/webapps/my-dev-site/wp-content/nfwlog/ninjafirewall.php
Loader's path to firewall : /home/******/webapps/my-dev-site/wp-content/plugins/ninjafirewall/lib/firewall.php
wp-config.php : found in /home/******/webapps/my-dev-site/wp-config.php
NinjaFirewall detection : NinjaFirewall WP Edition is loaded (Full WAF mode)
Loaded INI file : /etc/php74rc/php.ini
user_ini.filename : .user.ini
user_ini.cache_ttl : 300 seconds
User PHP INI : .user.ini found -
DOCUMENT_ROOT : /home/******/webapps/my-dev-site
ABSPATH : /home/******/webapps/my-dev-site/
WordPress version : 5.8.1
WP_CONTENT_DIR : /home/******/webapps/my-dev-site/wp-content
Plugins directory : /home/******/webapps/my-dev-site/wp-content/plugins
User Role : Administrator
User Capabilities : manage_options: OK - unfiltered_html: OK
Log dir permissions : /home/******/webapps/my-dev-site/wp-content/nfwlog dir is writable
Cache dir permissions : /home/******/webapps/my-dev-site/wp-content/nfwlog/cache dir is writable
NinjaFirewall (WP edition) troubleshooter v1.9.4
-
This reply was modified 4 years, 7 months ago by
dimsal.
Thread Starter
dimsal
(@dimsal)
Never mind, found the issue. I misconfigured the .htninja file — put a similar looking but different domain hence both issues. Now all resolved.