jisu
jisu

Reputation: 481

nginx permission denied issue

I am running parent proc with root user and workers procs with my username that has permission to read/write static folder. I am getting permission error.

2016/02/15 13:43:09 [error] 6944#0: *855 open() "/home/jisu/sited/site/static/css/bootstrap.min.css" failed (13: Permission denied), client: 24.185.93.168, server: web.site.edu, request: "GET /static/css/bootstrap.min.css HTTP/1.1", host: "web.site.edu", referrer: "http://web.site.edu/"

Procs:

[jisu@web home]$ ps -ef | fgrep nginx    
root      2603     1  0 Feb09 ?        00:00:00 nginx: master process /usr/sbin/nginx

jisu   6944  2603  0 13:38 ?        00:00:00 nginx: worker process

jisu   6945  2603  0 13:38 ?        00:00:00 nginx: worker process

jisu   7015  6846  0 13:44 pts/0    00:00:00 grep -F --color=auto nginx

Directory path is also correct:

location /static/ {
    alias /home/jisu/sited/site/static/;
}

Let me know if there are other configs you'd like to see.

Upvotes: 0

Views: 882

Answers (2)

jisu
jisu

Reputation: 481

Changing SELinux to “permissive” mode resolved this issue. It was in “enforcing” mode.

Upvotes: 3

Joshua DeWald
Joshua DeWald

Reputation: 3209

Does nginx have access to the entire path hierarchy? Since you have /home in there, nginx would need to be able to +x into each of the directories from /home to /static. Unfortunately just having it have access to only that directory isn't enough as far as I know. It does not need to be able to write to each, but it needs to be able to "execute" each directory in the path.

Upvotes: 1

Related Questions