将 nginx 工作进程用户设置为不同于 root
时在 CentOS7 上它返回 404 not found。
与 user root;
合作在 nginx.conf
root 3776 0.0 0.1 46580 1056 ? Ss 15:28 0:00 nginx: master process /usr/sbin/nginx -c /etc/nginx/nginx.conf
root 3777 0.0 0.3 47008 3540 ? S 15:28 0:00 nginx: worker process
不适用于
user nginx;
在 nginx.confroot 3837 0.0 0.1 46580 1056 ? Ss 15:35 0:00 nginx: master process /usr/sbin/nginx -c /etc/nginx/nginx.conf
nginx 3838 0.0 0.3 47008 3540 ? S 15:35 0:00 nginx: worker process
在
error.log
2019/06/07 15:35:06 [crit] 3838#3838: *1 stat() "/mnt/projects/samir" failed (13: Permission denied), client: [removed], server: [removed], request: "GET / HTTP/1.1", host: "[removed]"
我需要添加什么权限?我测试了将文件夹组更改为 nginx:nginx,添加 777 权限,也测试了 755。
最佳答案
解决方案:chmod +x -R /mnt/projects
关于Nginx 仅在将工作进程用户设置为 root 时有效,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56493642/