Reputation: 1385
I'm trying to make a simple server block on Nginx.
One the bottom part on the image link is a simple configuration. When I type the address in the browser it should fetch the index.html in the folder, instead I get a 403 error.
I set the user to nginx:apache in my /var/www folder chown -R nginx:apache /var/www
and still get a 403 error.
Upvotes: 0
Views: 407
Reputation: 56
First, make sure user nginx
has read access to the directory.
And if you use SELinux, it may be preventing nginx from serving the web pages. To fix this, change the SELinux context of the directory to httpd_sys_content_t
, and turn on httpd_can_network_connect
. For example:
chcon -Rt httpd_sys_content_t /var/www
setsebool -P httpd_can_network_connect 1
Upvotes: 1