Nginx open() “/etc/nginx/nginx.conf” failed (13: Permission denied)

Though I’ve set the full path to 777, this issue doesn’t gone.

Refer to SO

When you are getting permission denied errors on file access etc. for unknown reason, it might be related to SELinux. Especially when you see a period following permissions like drwxr-xr-x. shown byls -l for the file/dir in question, they could be mislabeled (you can see it by ls -Z) and cause the problem.

You should first check current SELinux mode by running getenforce. If it says Enforcing, then temporarily set the mode to Permissive by running setenforce 0, and see if your application works afterwards.

Please consult your distribution’s guide on SELinux for permanent fix, including setting the SELinux mode on start up, relabeling files or directories, updating policies, etc. Here’s Howto for CentOS.

猜你喜欢

转载自blog.csdn.net/xy707707/article/details/80819646