Nginx 仅在将工作进程用户设置为 root 时有效

标签 nginx permissions centos http-status-code-404 worker-process

将 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.conf
root      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/

相关文章:

ajax - fastcgi_finish_request 在打开 session 存在时创建挂起连接

docker - 使用反向代理后面的 Keycloak 登录后无限循环

c - 在Linux C程序中写入自己的可执行文件,错误 "Text file busy"

amazon-web-services - CloudFront 如何从 S3 在现有分发服务网站上设置反向代理

php - nginx 无法加载索引文件

emacs - Centos 7.6 emacsclient 找不到套接字

python - 找不到 "six",但已安装

postgreSQL 8.4.20 : How to solve missing oldestXID in pg_control preventing use of pg_upgrade on a legacy CentOS 6. 4 服务器?

ftp - PhpStorm 9 : Why doesn't the remote path's directories/files display when connected via FTP

android - 扫描 Android 设备以查找需要互联网连接的程序