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???

  • 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

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)

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.