# Separate UIDs for nginx

**URL:** <https://www.ruby-forum.com/t/separate-uids-for-nginx/211163>\
**Category:** NGINX\
**Created:** [August 27, 2011, 2:39pm UTC](https://www.ruby-forum.com/t/separate-uids-for-nginx/211163 "2011-08-27T14:39:35Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![luislavena](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/0ea827/32.png) [@luislavena](https://www.ruby-forum.com/u/luislavena)\
**Post date:** [August 27, 2011, 2:39pm UTC](https://www.ruby-forum.com/t/separate-uids-for-nginx/211163/1 "2011-08-27T14:39:35Z")

</div>

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:

> **[Separate UIDs for nginx](https://forum.nginx.org/read.php?2,214365,214365#msg-214365)**
>
> 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...

---

<div class="post-metadata">

**Author:** ![v1tzl1](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/8baadc/32.png) [@v1tzl1](https://www.ruby-forum.com/u/v1tzl1)\
**Post date:** [August 27, 2011, 4:17pm UTC](https://www.ruby-forum.com/t/separate-uids-for-nginx/211163/2 "2011-08-27T16:17:42Z")

</div>

Hi,

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:

> **[Re: Separate UIDs for nginx](https://forum.nginx.org/read.php?2,214365,214367#msg-214367)**
>
> 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...
