Forum Replies Created

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Contributor robertchen617

    (@robertchen617)

    Hello @tobias992,

    To make sure I understand the question, you have Nginx running as www-data. And you have multiple websites, each running as a separate PHP user. The PHP users are unable to clear the cache. This is because the cache folder and objects have 700 permissions and are owned by www-data. While configurations where PHP is running as the same user as Nginx conveniently work, PHP has no way to delete the cache the moment it runs as another user.

    I don’t have an answer for you right now. The most useful thing I could find when researching this was this article: https://github.com/rtCamp/nginx-helper/issues/63. They mention a set $user syntax for Nginx, but I haven’t tried it personally.

    Let’s keep this ticket open. In the meantime, there’s an approach I would like to try out. It might take some time to implement this approach, but I can keep you posted.

    Thanks,
    Robert

    Plugin Contributor robertchen617

    (@robertchen617)

    Yeah, the MD5 hash levels 1:2 (i.e. /e/3i/e3i445873845) makes it really hard to keep sites separate.

    It might be easier to just have a separate Nginx virtual host conf for each website (regardless of whether you’re using multisite or multiple site WordPress). That way, you can leverage the keys_zone to separate each website into different folder paths.

    If there’s another way of doing this, I’m not aware of it.

    Plugin Contributor robertchen617

    (@robertchen617)

    Unfortunately, we haven’t really tested this plugin with multisite (that is, where multiple sites are using the same WordPress core).

    Are you currently using FastCGI cache with your current set up? If so, are you able to separate each site’s cache files into their own folders?

    Thanks,
    Robert

    Plugin Contributor robertchen617

    (@robertchen617)

    Hi @ffemtkl,

    To set up multisite with FastCGI Cache, one site will be configured like this:

    
    fastcgi_cache_path /var/lib/nginx/siteone levels=1:2 keys_zone=SITEONE:1440m;
    
    server {
        location ~ \.php$ {
            fastcgi_cache SITEONE;
        }
    }
    

    and the second site like this:

    
    fastcgi_cache_path /var/lib/nginx/sitetwo levels=1:2 keys_zone=SITETWO:1440m;
    
    server {
        location ~ \.php$ {
            fastcgi_cache SITETWO;
        }
    }
    

    Within the plugin settings for site one, make sure the CachePath is set to /var/lib/nginx/siteone

    Likewise for site two, set the CachePath to /var/lib/nginx/sitetwo

    Hope this helps.

    • This reply was modified 6 years, 5 months ago by robertchen617. Reason: formatting code block
Viewing 4 replies - 1 through 4 (of 4 total)