I want to serve my static files with nginx. But even though I have tried many times, I could not do it. This is my configuration file:

    server {
    listen       80;
    server_name  sis;

location / {
        fastcgi_param REQUEST_METHOD $request_method;
        fastcgi_param QUERY_STRING $query_string;
        fastcgi_param CONTENT_TYPE $content_type;
        fastcgi_param CONTENT_LENGTH $content_length;
        fastcgi_param GATEWAY_INTERFACE CGI/1.1;
        fastcgi_param SERVER_SOFTWARE nginx/$nginx_version;
        fastcgi_param REMOTE_ADDR $remote_addr;
        fastcgi_param REMOTE_PORT $remote_port;
        fastcgi_param SERVER_ADDR $server_addr;
        fastcgi_param SERVER_PORT $server_port;
        fastcgi_param SERVER_NAME $server_name;
        fastcgi_param SERVER_PROTOCOL $server_protocol;
        fastcgi_param SCRIPT_FILENAME $fastcgi_script_name;
        fastcgi_param PATH_INFO $fastcgi_script_name;
        fastcgi_pass 127.0.0.1:8080;
        }

location /a {
        root /home/ilker;
        }

}

When I write localhost/a to my browser, I get: 403 Forbidden

And this is the ouptut of cat /var/log/nginx/error.log:

2011/11/12 06:46:36 [error] 13950#0: *2 open() "/home/ilker/a" failed (13: Permission denied), client: 127.0.0.1, server: sis, request: "GET /a HTTP/1.1", host: "localhost"

And lastly /home/ilker/a permissions:

drwxrwxrwx. 2 ilker ilker 4096 Nov 12 06:37 a
link|improve this question
1  
Thank you for your comment but it is not. The error on your link is stat error, but in my error log it is open error. – İlker Dağlı Nov 12 '11 at 5:17
stat ~ execute, open ~ read. Also keep in mind that never chmod 777. – quanta Nov 12 '11 at 5:28
I did 777 for testing, and it did not work... – İlker Dağlı Nov 12 '11 at 6:53
1  
Are the permissions for /home/ilker open too? – Shish Nov 12 '11 at 11:27
show 1 more comment
feedback

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
or
required, but never shown

Browse other questions tagged or ask your own question.