You are not logged in.

#1 2011-09-01 08:59:11

arturr
Member
Registered: 2011-01-25
Posts: 4

[SOLVED]Nginx 403 error after update

Hello,
I am running nginx 1.0.6-2. on 64 bit OpenVZ. This problem occurred after update form 1.0.5. When I try to reach a simple static page with hello world I get 403 error. I hadn't touch configuration file. I tried to manipulate with permissions but still nothing. Here is my currently permissions.

[root@server srv]# ls -l
total 8
dr-xr-xr-x 2 root ftp  4096 Aug  9 16:41 ftp
drwxr-xr-x 3 root http 4096 Aug 30 02:37 http

Here is my static page.

[root@server nginx]# ls -l
total 4
-rwxrwxrwx 1 root http 5 Aug 30 02:38 index.html

Even though it have 777 I still can't reach it.
Here is my config file for nginx without comments.

worker_processes  1;




events {
    worker_connections  1024;
}


http {
    include       mime.types;
    default_type  application/octet-stream;
    sendfile        on;

    keepalive_timeout  65;

    #gzip  on;

    server {
        listen       80;
        server_name  localhost;

        location / {
            root   html;
            index  index.html index.htm;
        }

        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   html;
        }


    }
}

Thanks in advance for any help.
Best regards

Last edited by arturr (2011-09-01 20:51:40)

Offline

#2 2011-09-01 13:53:43

jakobm
Member
Registered: 2008-03-24
Posts: 132

Re: [SOLVED]Nginx 403 error after update

Can you check the nginx logs for more detailed error messages?

Offline

#3 2011-09-01 14:51:53

toofishes
Developer
From: Chicago, IL
Registered: 2006-06-06
Posts: 602
Website

Re: [SOLVED]Nginx 403 error after update

You have a relative "root". The Arch packager changed the default root from something in /srv to a more generic /usr/share directory as the default as you want to configure this on your own anyway. Use a non-relative root (which is a good idea anyway) and things should work.

Offline

#4 2011-09-01 15:02:05

kvn
Member
Registered: 2010-08-13
Posts: 12

Re: [SOLVED]Nginx 403 error after update

quick fix, appears /srv isn't root for http anymore

cd /usr/share/nginx/http/
sudo cp -R /srv/http/nginx/* .

Offline

#5 2011-09-01 15:07:41

kvn
Member
Registered: 2010-08-13
Posts: 12

Re: [SOLVED]Nginx 403 error after update

make sure to also fix any /srv paths to the new /usr/share/nginx/http path in your /etc/nginx/conf/nginx.conf

Offline

#6 2011-09-01 18:48:35

toofishes
Developer
From: Chicago, IL
Registered: 2006-06-06
Posts: 602
Website

Re: [SOLVED]Nginx 403 error after update

kvn wrote:

make sure to also fix any /srv paths to the new /usr/share/nginx/http path in your /etc/nginx/conf/nginx.conf

Putting your web root in /usr/share is a stupid idea. You should just override defaults with /srv/ as appropriate for your own setup. The shipped default is only so it shows a page at all the first time you start it up, not a recommendation you put your own files there.

Offline

#7 2011-09-01 20:50:44

arturr
Member
Registered: 2011-01-25
Posts: 4

Re: [SOLVED]Nginx 403 error after update

Thank you for help. I choose /srv/www as my main folder with sites it fits for me. I changed the root and now everything is working perfectly. Thanks for help one more time
Best regards

Offline

Board footer

Powered by FluxBB