You are not logged in.
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
Can you check the nginx logs for more detailed error messages?
Offline
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
quick fix, appears /srv isn't root for http anymore
cd /usr/share/nginx/http/
sudo cp -R /srv/http/nginx/* .
Offline
make sure to also fix any /srv paths to the new /usr/share/nginx/http path in your /etc/nginx/conf/nginx.conf
Offline
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
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