Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I installed nginx and all php extensions.

My web directory is /usr/share/nginx/www/

Browsing to http://localhost shows "Welcome to nginx"
Browsing to http://localhost/vnstat/ shows 403 forbidden

ls -l

-rw-r--r-- 1 root root 1631 Oct 19 15:08 24.png  
-rw-r--r-- 1 root root  383 Jul  7  2006 50x.html  
-rw-r--r-- 1 root root  151 Oct  4  2004 index.html  
drwxr-xr-x 4 root root 4096 Oct 19 15:45 vnstat  
share|improve this question

2 Answers 2

nginx need read (r) permissions for the file and execute (x) permissions for the folders. So in your case it needs execute for:

/usr
/usr/share
/usr/share/nginx
/usr/share/nginx/www
/usr/share/nginx/www/vnstat

and read for:

/usr/share/nginx/www/vnstat/files

check with:

namei -l /usr/share/nginx/www/vnstat/files
share|improve this answer

I don't know much about nginx and vnstat, but webservers usually deliver files or script output, not directories.

Though your directory prmissions for vnstat/ look correct, your webservice is probably not allowed to read or execute the directory index (i.e. index.html or index.php) inside vnstat/. File system permissions are probably at fault, though it could be your nginx configuration. Check what is inside the vnstat directory and to make debugging easier, try calling the vnstat/index.php (or whatever the index should be) directly in your webbrowser.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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