Reputation: 3122
I'm trying to configure nginx to serve static files from a directory. And getting 403 Forbidden when trying to access the path /static/
Here is parts from my config:
user root;
<...>
http {
<...>
server {
<...>
location /static/
{
alias /home/my_user/static/;
autoindex on;
}
<...>
}
}
I also have permissions 777 recursive for /home/my_user/static/
and yes i have index.html inside the directory. And still getting the error. Why?
os: Centos 7
Upvotes: 0
Views: 2903
Reputation: 3122
Enabling flag
/usr/sbin/setsebool -P httpd_read_user_content true
Solves the problem.
Upvotes: 1