Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

purge_all permissions problem #283

Open
thend20 opened this issue Sep 14, 2022 · 0 comments
Open

purge_all permissions problem #283

thend20 opened this issue Sep 14, 2022 · 0 comments

Comments

@thend20
Copy link

thend20 commented Sep 14, 2022

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.

        location ~ /purgeall {
            fastcgi_pass         php;
            fastcgi_cache        WORDPRESS;
            fastcgi_cache_purge  PURGE purge_all from 127.0.0.1;
        }

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

+            $_url_purge = home_url() . '/purgeall';
+            $this->log( '- Purging URL | ' . $_url_purge );
+            $this->do_remote_get( $_url_purge );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants