change nginx user in config >> 403 error index.html forbidden

Maxim Dounin mdounin at mdounin.ru
Fri Sep 16 16:24:35 UTC 2011


Hello!

On Fri, Sep 16, 2011 at 12:16:56PM -0400, martijnsenden wrote:

> Hi All,
> 
> I have just installed NGINX 1.1.2. I made my own configuration and
> makefile and installed the nginx server.
> When I set the config to:
> user root root;
> I get the hello world index.html file provided by the nginx installer
> (./html/index.html).
> 
> When I set the config to:
> user nginx nginx;
> (which is what I want), I get a 403 message. The error.log says the
> index.html is forbidden.
> 
> These are the file permissions I have set on the files in the ./html
> directory:
> total 16
> -rw-r--r-- 1 someowner nginx  383 Sep 16 15:27 50x.html
> -rw-r--r-- 1 someowner nginx  151 Sep 16 15:27 index.html
> -rw-r--r-- 1 someowner nginx 6971 Sep 16 15:27 ngx_core_module.html
> 
> The nginx user is a member of the nginx group (which has the required
> permission to view the index.html):
> $ groups nginx
> returns:
> nginx : nginx
> 
> So, what should I do to give the worker processes of nginx access to
> these files? I'm at a loss here.

Make sure nginx use have at least search permissions for all 
directories above document root.

Maxim Dounin



More information about the nginx mailing list