Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

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


and read for:


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


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.