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

Conflict Fastcgi cache folder permissions with Nginx #259

Open
glen777 opened this issue Jul 10, 2021 · 1 comment
Open

Conflict Fastcgi cache folder permissions with Nginx #259

glen777 opened this issue Jul 10, 2021 · 1 comment

Comments

@glen777
Copy link

glen777 commented Jul 10, 2021

I do not have the ngx_cache_purge module, because it apparently would require uninstalling nginx and reinstalling, thus requiring my sys admin to re-do a lot of work we’ve done on that server. (and doesn’t that module require a nginx paid subscription ?)

So we chose the purge method of: ‘Delete local server cache files. Checks for matching cache file in RT_WP_NGINX_HELPER_CACHE_PATH.’
We set the path as /home/site-owner-user/nginx-cache/cache

Due to the virtualmin PHP setup, it created it's own PHP pool for the virtual server and therefore ran PHP under the site-owner-user. But NGINX uses the cache folder as user 'www-data', however this directory was not writable by other users. Therefore when wordpress tried to clear the cache, the folder could not be deleted and recreated.

I could fix this by manually changing the folder permissions, but when wordpress recreated the cache folder it would now be owned by the user 'classicwp' and NGINX could no longer write cache files to that location. When we tried to do a shared ‘group’ for them, nginx just ignored that. NGINX doesn't allow us to specify the file permissions for the cache files it creates. They're stuck at a level that does not allow the group to write.

We CAN make it work when we change the PHP user to www-data (same as nginx), but this raises security problems if 20 wordpress clients all run as that same nginx user, www-data.
So, what is the solution?
Thanks so much for any ideas

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants