I am trying to set up nginx so that a certain url produces the directory index of a certain directory on my server. Currently this is what my default.conf looks like.
location / {
root /usr/share/nginx/html;
index index.html index.htm;
}
location /files/ {
root /home/myfiles/Downloads;
autoindex on;
}
However when I try to go to mysite.com/files/ or mysite.com/files I get a 403 Forbidden error.
Looking into the error log I saw
2012/01/08 16:23:18 [error] 17619#0: *1 "/home/myfiles/Downloads/files/index.html" is forbidden (13: Permission denied), client: some.ip.addr.ess, server: _, request: "GET /files/ HTTP/1.1",
I don't want it to search for files/index.html, I just want the directory index of Downloads. What do I need to change to make things work this way?