Webserver Root Folder Permission denied for Nginx Server Blocks on CentOS 7.2
Hi,
I have a problem I have installed nginx on Centos 7 and I get an 403 on frontend and if I run sudo tail -f /var/log/nginx/error.log I get an permission denied error 2016/07/18 22:11:47 [error] 32598#32598: *7 "/var/www/example.com/html/index.html" is forbidden (13: Permission denied), client: XX.XXX.XXX.XXX, server: example.com, request: "GET / HTTP/1.1", host: "example.com" the owner of the directory /var/www/example.com/html/index.html is not root, it is a user which I create and give him admin/root priviliges so it can use sudo. How can I fix that? ###Update First I am not using apache and I already give the permission sudo chown -R $USER:$USER /var/www/example.com/html sudo chmod -R 755 /var/www logged in as the admin user and also tried to give nginx the permission (Permission the same for parent directories) sudo chown -R nignx:nginx /var/www/example.com/html sudo chmod -R 755 /var/www |
Welcome to LQ!
Please stop abusing chmod/chown until someone who can help you steps up. |
Quote:
|
Webserver Root Folder Permission denied for Nginx Server Blocks on CentOS 7.2
SELinux might not be permitting Nginx to proxy to my server. Running the command below might fix the issue.
Code:
/usr/sbin/setsebool httpd_can_network_connect true |
Quote:
The second, use namei command to check tree permission as bellow Code:
namei -l /var/www/example.com/html For example, How To Install Wordpress with nginx on CentOS 6 |
All times are GMT -5. The time now is 09:02 AM. |