purge_all attempts to recursively remove all files under the nginx cache dir. However, when nginx is running as user nginx and PHP is ran as php, the purge_all does not have adequate permissions to clear the cache.
I would suggest an alternate purge_all which does a GET call to nginx to a purgeall endpoint and allow the user setup a location block for /purgeall. This could use the purge_all feature of the fastcgi_cache_purge module..for example.
purge_all
attempts to recursively remove all files under the nginx cache dir. However, when nginx is running as usernginx
and PHP is ran asphp
, the purge_all does not have adequate permissions to clear the cache.I would suggest an alternate
purge_all
which does a GET call to nginx to apurgeall
endpoint and allow the user setup a location block for/purgeall
. This could use thepurge_all
feature of the fastcgi_cache_purge module..for example.This could be accomplished by letting the user use the original
unlink_recusive
method, or by using this new method using a simple GET call