|Subject:||'403 Forbidden' error after installing nginx|
|From:||Stefan Scott (lis...@ruby-forum.com)|
|Date:||Nov 28, 2008 1:30:48 am|
Yesterday everything worked fine when I installed nginx 0.6.33 at one VPS (virtual private server) web hosting provider (xencon.net) using Debian Etch. Today I installed nginx 0.6.34 (slightly newer) at a different VPS web hosting provider also using Debian Etch (gandi.net), and when I point my browser to the site at the second provider I'm getting the error '403 Forbidden'.
Here is what the last line in file error.log in directory /usr/local/nginx/logs/ says at the second provider:
2008/11/28 09:50:01 [error] 9156#0: *1 "/usr/local/nginx/html/index.html" is forbidden (13: Permission denied), client: 111.222.333.444, server: localhost, request: "GET / HTTP/1.1", host: "mydomain.com"
In both cases, I was following the steps outlined here:
Well - there's two things that changed from yesterday to today: different release, and different VPS web hosting provider.
To test if if was due to the different release, I tried deleting everything I could find from the install at the second provider (per the instructions in the first link above, the install on Debian Etch had been done manually, because the nginx package included with Debian Etch is outdated) - ie I deleted the ~/sources directory and the /usr/local/nginx directory and then installed version 0.6.33 this time instead of 0.6.34 - but the '403' error at the second provider continued to occur.
Maybe there's something different between these two providers. Doing 'ls -l' on the files in /usr/local/nginx, I did see that the 'read' permission is always YES at the first VPS provider, and always NO at the second VPS provider:
FIRST HOSTING PROVIDER /usr/local/nginx/html: -rw-r--r-- 1 root staff 383 2008-11-26 20:59 50x.html -rw-r--r-- 1 root staff 151 2008-11-26 20:59 index.html
SECOND HOSTING PROVIDER /usr/local/nginx/html: -rw-r----- 1 root staff 383 2008-11-28 07:42 50x.html -rw-r----- 1 root staff 151 2008-11-28 07:42 index.html
So I used the command 'chmod a+x -R' to allow read access on all these files and directories, but the error still occurs.
When I google 'nginx 403 forbidden' I see that this error has also occurred for some other people (but usually in more complicated situations involving nginx as a reverse proxy with mongrels upstream), and people have tried either allowing read access (which never helped), or changing the file owner (which did help in some cases, where reverse proxying and mongrels were involved):
In my case, this is just a "hello, world" situation, where I'm installing nginx to see if I can connect from my browser, and I can't quite understand what the file owner permissions have to do with it, so I'm unsure what I should do.
Any suggestions would be greatly appreciated!
-- Posted via http://www.ruby-forum.com/.