Re: 2 different users needing write permission to cache folder. Nginx does not allow a ‘group’ here.
On my Nginx server with wordpress sites I want to use fastCGI caching, so I use the WP nginx-helper plugin. I 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
But 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 for any ideas.