Separate UIDs for nginx

v1tzl1 nginx-forum at nginx.us
Sat Aug 27 12:39:06 UTC 2011


Hi everyone,

I am planning to move away from apache itk + mod_php to nginx and
php-fpm. I have a few virtual hosts (less than 10) and unix
user-accounts associated with these vhosts. I already found the pool
option of fpm which looks like the perfect way for me to match the
domains to the uid php will be using.
However right now nginx itself is always running as user www-data so
www-data needs read permissions to all static files of all vhosts. Is
there a way to configure nginx to use different uid/gids on different
domains (so a user directive inside a server block)? This way my users
won't bother me that their website isn't running anymore everytime they
screw up their file/directory permissions.

Yours Martin

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,214365,214365#msg-214365



More information about the nginx mailing list