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 set up nginx on Ubuntu 12.04 and when remotely accessing a file other than the index.htm/php/html, the server says that access is forbidden. I tried to search for a solution but no luck. Any ideas/hints/solutions???

share|improve this question
    
Have you checked the permissions of the files/directories? ls -l will list all the files and their permissions. If the permissions of index.* are the same as the other files then something else is wrong. Let us know if this is the case –  cosmorogers Jun 17 '12 at 18:53
add comment

1 Answer

403 errors in nginx get thrown when ownership of other files isnt compatible with the user that nginx runs as. Use ls -l on the web root folder to find ownership of the files. Make sure that the group part is www-data. If its in any user-level folders (such as your home directory), make sure that www-data can read the file directory structure to there.

Without more details, though, I can't explain how to fix this any better... attaching details about the file structure, where on the drive your files are sitting, etc. may help.

(Source: Me, as I'm on the nginx team)

share|improve this answer
add comment

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.