By newbie
Hello, yesterday i installed wordfence and then eanbled Nginx FastCGI. but FastCGI isnt working. all pages are maked as MISS.
then i disabled wordfence and everything is fine again. i contacted with wordfence auther but till now no answer.
is there anyone using Nginx FastCGI and wordfence together??
my FastCGI setup is pretty basic.
fastcgi_cache_path /var/run/nginx-cache levels=1:2 keys_zone=WORDPRESS:100m inactive=60m;
fastcgi_cache_key "$scheme$request_method$host$request_uri";
fastcgi_cache_use_stale error timeout invalid_header http_500;
#fastcgi_cache start
set $no_cache 0;
# POST requests and urls with a query string should always go to PHP
if ($request_method = POST) {
set $no_cache 1;
}
if ($query_string != "") {
set $no_cache 1;
}
# Don't cache uris containing the following segments
if ($request_uri ~* "(/wp-admin/|/xmlrpc.php|/wp-(app|cron|login|register|mail).php|wp-.*.php|/feed/|index.php|wp-comments-popup.php|wp-links-opml.php|wp-locations.php|sitemap(_index)?.xml|[a-z0-9_-]+-sitemap([0-9]+)?.xml)") {
set $no_cache 1;
}
# Don't use the cache for logged in users or recent commenters
if ($http_cookie ~* "comment_author|wordpress_[a-f0-9]+|wp-postpass|wordpress_no_cache|wordpress_logged_in") {
set $no_cache 1;
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
fastcgi_cache WORDPRESS;
fastcgi_cache_valid 200 60m;
fastcgi_cache_bypass $no_cache;
fastcgi_no_cache $no_cache;
}
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
FastCGI Caching does full-page caching, which means changes to output won’t take until the cache is flushed for the requested URI, or entirely (in some cases). Unfortunately, the plugin that used to work with NGINX to aid in flushing the cache has not been updated in a while which makes this a manual process.
Some plugins may work with FastCGI Cache, others may not – there’s really no guarantee as to what will and won’t work unfortunately.
I’ve never ran in to issues with FastCGI (without caching) and WordFence – though I rarely use FastCGI Caching unless there’s a viable solution readily available for flushing the cache and it’s tested across the platform to ensure that it works entirely. As of right now, it’s a manual process, or a custom solution needs to be implemented to perform the flushing.
Enabling FastCGI caching, as you’re experiencing, can have some odd and unintended results from time to time, which is why you really need to test it 100% in development before using it in production.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.