So the reccomendation for any nginx server is to have seperate users for Nginx and PHP but that cause huge headaches for plugins like this.
You either have to pay for nginx plus, compile a module yourself, or go through other PITA ongoing steps.
I found a simple way to make this work, so i thought i would share since i hadnt seen this solution anywhere else.
Use bindfs. Create a folder, bindfs mount it to your nginx cache folder, point this plugin to that folder. Boom, she works.
Cheers
]]>Hi,
There’s an undefined variable $item
in the beginning of NginCache::validate_dirlist( $list )
function.
PHP Warning: Undefined variable $item in /path-to-wp/wp-content/plugins/nginx-cache/nginx-cache.php on line 211
PHP Warning: Trying to access array offset on value of type null in /path-to-wp/wp-content/plugins/nginx-cache/nginx-cache.php on line 211
Thanks ??
]]>This plugin is being used by hackers to gain access to directories, overwrite files, and set up zombie sites.
Is any work being done to identify the vulnerability in this plugin and patch it?
]]>It seems there are issues clearing fastcgi_cache (using path) with PHP 8+. Might be for other clearing methods as well.. but that is what I noticed. I believe it is due to the deprecated use of arrays.
2022/02/27 16:29:58 [error] 39#39: *811 FastCGI sent in stderr: “PHP message: PHP Warning: foreach() argument must be of type array|object, bool given in /siteroot/wp-content/plugins/nginx-cache/nginx-cache.php on line 210” while reading response header from upstream, client: 10.10.10.1, server: servername, request: “GET /wp-admin/ HTTP/1.1”, upstream: “fastcgi://10.11.0.1:9000”, host: “urlhere”, referrer: “urlhere”
]]>As for the title:
It’d be super-useful to have the possibility to set the “Cache Zone Path” via wp-config.php in stateless environments (eg. K8s).
]]>Hi I was thinking to swap out their default Nginx purge cache plugin for something with simple code like yours, I don’t want AJAX or JS scripts
And thanks for your contribution
]]>It’s too bad this awesome plugin isn’t being updated as it throws errors, and even caused my website to go into a redirect loop, taking it down, until I deleted the plugin via FTP and cleared my cache manually.
Any updates in the near future?
]]>Hi, I am getting this error on the plugin page: “Filesystem API could not be initialized.”. I’m assuming it has to do with the permissions of the cache folder, but I’m not sure what permissions/ownership it should have.
I am running Ubuntu 18.04 with nginx and using Virtualmin to run multiple VPS.
Any assistance would be appreciated!
]]>Hi there,
I’m using your plugin in order to clear fastcgi cache. I have the right folder setup on the plugin dashboard, and I got the permissions after playing with my folder permissions for a little while.
I save, everything OK.
However, when I hit purge, nothing happens on my folder. The message says that everything went ok, but it is not the case. The folder elements are intact.
What could the problem be?
Thanks a lot
]]>Not sure if this is the best place to post this question.
Are there benefits to using Nginx Cache if you’re already using Cloudflare?
It seems that Cloudflare is similar in nature as Nginx Cache, they both cache pages and serve cache until purged.
Thanks!
]]>Hey, I’m having an issue that woo commerece pages in safari are still caching despite excluding them
]]>A bump of this issue: https://www.ads-software.com/support/topic/cache-zone-path-does-not-appear-to-be-a-nginx-cache-zone-directory-2/
The proposed solution is a fine workaround, but a more specific conditional check should be put in place.
No updates made to this plugin for at least 6 months (the latest version as I write this is still 1.0.4)? Is it still being maintained? That would be nice to know so that I can replace it with something else before it becomes even more troublesome.
]]>I’ve recently upgraded PHP to 7.2 using the same configurations as before when using this plugin. I’m now having a random issue (not sure if it’s the plugin causing it or something else) where the entire FastCGI cache folder will be deleted and recreated as root. This is not reproducible by clearing cache though. But it only happens when this plugin is activated. Both PHP and NGINX are running as the same user and there are no issues when first creating the folder with proper permissions. But give it an hour? and the folder will be gone and only accessible as root.
What might be causing this?
]]>if it purges all caches then maybe problematic
]]>I’m using both Nginx Cache and Redis Object Cache. I’d like to clear both caches as part of an automated deployment. ‘wp cache flush’ clears the Redis cache, but not the Nginx cache.
What is the best way to clear both caches from a shell script? Should I run ‘wp cache flush’ and then delete the contents of the /cache directory?
Thanks
]]>Thanks for the great plugin. I wanted to make a suggestion: consolidate both redis cache purge and the nginx cache purge under a single admin bar menu for ease of use (you already have the one for Nginx). It also would be great if both cache settings menus lied under Tools instead of Redis being under settings and Nginx being under Tools.
]]>Hello,
As a previous post described, with newer versions of Nginx sometimes the directories of the cache tree are not created as a 32bit hash, but as a longer string. In order to make it work, I had to modify the function validate_dirlist and add this at the top of the function:
//If file name has a dot, dont make this check. Nginx sometimes creates cache files like:
// /var/www/site/nginx-cache/b/db/891535e53e15b5ddef11154f9a403dbb
// /var/www/site/nginx-cache/b/db/891535e53e15b5ddef11154f9a403dbb.0000017454
if ( $item[ ‘type’ ] === ‘f’ && strpos($item, “.”) !== false ) {
return true;
}
This is still needed in plugin version 1.04. Please, check if my proposed modification is ok and update your plugin accordingly.
Thank you!
]]>hey guys,
as it is clear,i am using a litespeed websever. if I use a nginx caching plugin, will i experience isuues on my site?
Even setting the correct path in the field I still get the
‘“Cache Zone Path” does not appear to be a Nginx cache zone directory’ error message.
Diggin into the code I noticed that the plugin checks whether the path has files, and if those files have a 32 digit name length, indicating that it′s a MD5 file. The problem is that most recent versions of Nginx creates within fastcgi_cache_path′s directory files with names in the format “3e6d7a44a600768543daac6ee4b4da0f.0000002806, thus causing the “validate_dirlist” function to return false.
I′m using nginx 1.15.3 on an Ubuntu server.
Whether I network activate the plugin or activate it on each subdomain / site in my network, I do not get the NGINX option under tools, and it either case I do not get an option to set the path anywhere.
If this does not work under the latest wp version, let us know, or update the info you give.
Thanks
]]>Hello,
Since there is not much document for referrence, I would like to ask your suggestion on how to us Nginx Cache correctly.
On my site, there are Redis cache and Nignx helper(https://www.ads-software.com/plugins/nginx-helper/) , and Wp super cache for page cache, so what is your suggestion on how use Nginx Cache?
I am just wondering whether there will be any conflict among these plugins, looking forwand to your reply. have a nice day.
Alex
]]>Hello,
should I input data/nginx/cache in the field of Cache Zone Path?
anyway to check the cache directory by FTP ? if yes, what is the directory?
Thanks a lot
Alex
]]>Hi,
I have enabled auto cache flush. Well, all cache including cache folder gets deleted. There is no permission problem. But my site shows 500. If I reboot nginx, it starts working again.
cpanel
i’ve specified an absolute page for the cache:
/home/<use>/public_html/wp/wp-content/plugins/nginx-cache/data
the setup page accepts this
when i try to purge i get the error (Filesystem API could not initialized)
when i load the front page no cache is written, but the purge button becomes active
i am not a wp maven – but i do major code in php/js
thanks for any assistance
Otis Maclay
Have you seen this yet on any site running the latest Jetpack install? I just setup two new servers (lemp) using php7.0 and wordpress 4.8. Also SSL. I am running into an issue when the cache clears, WordPress Admin prompts for FTP credentials. Either disabling the Jetpack plugin or Nginx Cache resolves the issue. Furthermore, simply installing Jetpack will not cause the error. It only happens when you connect it to your WordPress.com account. It will error out shortly within 5 mins.
Funny thing is that I have not had this issue on my other site without SSL enabled. The only difference is we are not running WordPress 4.8 and are running the old Nginx Cache Helper module. Oh the other thing is that if I downgrade Jetpack to say 4.7.1, it works flawlessly.
I’m kind of at a loss here for what to look at next. Any help would be appreciated. For now, we are no longer running Jetpack. Cache is more important ??
]]>Is it possible to allow an “Editor” to access the plugin just to purge the cache?
Because it don’t get always purged automatically.
Thanks
]]>I’m using your plugin and network activated it.
But I have to set the cache path for every site seperate.
Can you please fixt it?
I’m using split_clients and spreading the cache across two AWS EBS volumes. In order to use this plugin, would I have to create a folder structure like this
/mnt/cache/website_com_1
/mnt/cache/website_com_2
and the input /mnt/cache into the plugin settings? Thanks!
]]>Hello,
I have a strange issue, whenever I try to purge the cache the whole cache folder is deleted, not just the cached data. This is leading to issues as each time I will have to create the cache folder again. I have successfully set the cache zone path both in the plugin and in the nginx config. I am setting the cache folder with the correct ownership and either 750 or 755 permission.
Will you please shed some light on the issue, as it is quite strange?
Thank you.
]]>Hello!
I have created the cache zone path a couple of times, then saved the correct path in /tools/nginx: Cache Zone Path.
But then the folder gets automatically deleted, not really sure the cause.
Any help would be appreciated
]]>