Skip to content

purge_all permissions problem #283

Open
@thend20

Description

@thend20

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 );

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions