Separate UIDs for nginx

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:,214365,214365#msg-214365


Nginx is not capable of dynamically changing the uuid, however, it is
fairly light on memory so you can do this by running an instance of
nginx per user.

Posted at Nginx Forum:,214365,214367#msg-214367