NinjaFirewall causes Nginx FastCGI to not work
-
Hi,
I am using Nginx on my site, with FastCGI caching enabled. When installing Ninjafirewall, the caching stops.
It happens on WAF mode Only. Firewall works fine, but the nginx cache does not work anymore.
Here are the nginx lines that enable caching on my server:fastcgi_cache_path /etc/nginx/cache levels=1:2 keys_zone=MYAPP:100m inactive=60m; fastcgi_cache_key "$scheme$request_method$host$request_uri"; server { ... ... location ~ \.php$ { include snippets/fastcgi-php.conf; fastcgi_pass unix:/var/run/php/php7.4-fpm.sock; fastcgi_cache MYAPP; fastcgi_cache_valid 200 60m; }
When firewall is disabled, the /etc/nginx/cache directory has cached files from nginx. When firewall is enabled, the directory is empty.
Here is the output of the troubleshooter with WAF off, WP mode on:
NinjaFirewall (WP edition) troubleshooter HTTP server : nginx/1.18.0 PHP version : 7.4.10 PHP SAPI : FPM-FCGI auto_prepend_file : none wp-config.php : found in /var/www/domain.com/wp-config.php NinjaFirewall detection : NinjaFirewall WP Edition is loaded (WordPress WAF mode) Loaded INI file : /etc/php/7.4/fpm/php.ini user_ini.filename : .user.ini user_ini.cache_ttl : 300 seconds User PHP INI : none found DOCUMENT_ROOT : /var/www/domain.com ABSPATH : /var/www/domain.com/ WordPress version : 5.5.1 WP_CONTENT_DIR : /var/www/domain.com/wp-content Plugins directory : /var/www/domain.com/wp-content/plugins User Role : Administrator User Capabilities : manage_options: OK - unfiltered_html: OK Log dir permissions : /var/www/domain.com/wp-content/nfwlog dir is writable Cache dir permissions : /var/www/domain.com/wp-content/nfwlog/cache dir is writable
And here is the output when WAF mode is on (cache not working)
NinjaFirewall (WP edition) troubleshooter HTTP server : nginx/1.18.0 PHP version : 7.4.10 PHP SAPI : FPM-FCGI auto_prepend_file : /var/www/domain.com/wp-content/nfwlog/ninjafirewall.php Loader's path to firewall : /var/www/domain.com/wp-content/plugins/ninjafirewall/lib/firewall.php wp-config.php : found in /var/www/domain.com/wp-config.php NinjaFirewall detection : NinjaFirewall WP Edition is loaded (Full WAF mode) Loaded INI file : /etc/php/7.4/fpm/php.ini user_ini.filename : .user.ini user_ini.cache_ttl : 300 seconds User PHP INI : .user.ini found - DOCUMENT_ROOT : /var/www/domain.com ABSPATH : /var/www/domain.com/ WordPress version : 5.5.1 WP_CONTENT_DIR : /var/www/domain.com/wp-content Plugins directory : /var/www/domain.com/wp-content/plugins User Role : Administrator User Capabilities : manage_options: OK - unfiltered_html: OK Log dir permissions : /var/www/domain.com/wp-content/nfwlog dir is writable Cache dir permissions : /var/www/domain.com/wp-content/nfwlog/cache dir is writable
Please advise.
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘NinjaFirewall causes Nginx FastCGI to not work’ is closed to new replies.