I use nginx 1.4.4 and I created a chrooted user. This user can only see his /home/user folder, and I created in a "www" folder.

I put in my virtual host file :

root /home/user/www;

But I have an error :

*1 stat() "/home/crm/www/" failed (13: Permission denied)

I try to put chmod 777 on home, home/user, home/user/www, but I got the error.

I took a look on this question : nginx + PHP-FPM = "permission denied" error 13 in nginx log; configuration mistake?, but I can't change owner the www folder.

How can I correct this ? Thanks.


Add your user to www-data group (Nginx should run as www-data).

  • Or chown www to user:www-data. (with r option). – Thomas Decaux Feb 7 '14 at 13:34

Ok a lot of chmod after... I achieve what I wanted ! I got an other error on :

My config (namei -om /home/crm/www) :

drwxr-xr-x root root /
drwxr-xr-x root root home
drwxr-xr-x root root crm
drwxrwxrwx crm  sftp www

And I have another error too on :

fastcgi_param SCRIPT_FILENAME   $request_filename;

The filename was bad an make an "file not found error" too.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.