Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nginx user 指令权限问题 导致无法上传 #1295

Closed
jinwyp opened this issue May 11, 2022 · 1 comment
Closed

Nginx user 指令权限问题 导致无法上传 #1295

jinwyp opened this issue May 11, 2022 · 1 comment

Comments

@jinwyp
Copy link

jinwyp commented May 11, 2022

当nginx 的user 指令 使用root 时 启动nginx 一切正常

user root;

没有问题

当不使用root 权限启动时

例如 当nginx 的user 指令 使用www-data时 启动nginx 上传接口post 报错500
user www-data www-data ;

上传图片 或文件 post接口报错500
bug

cloudreve 使用官方Systemd 并加入 一行 启动的
User=www-data

所有相关上传目录权限都已经设置给 www-data 但还是报错.

不知道cloudreve 里面有什么地方的权限在存储策略的目录里创建目录后, nginx的worker 无法识别到目录权限,

目前只能使用nginx user root 指令运行nginx

如何才能不使用 user root 权限运行nginx

具体一键安装脚本 可以看这里
https://github.com/jinwyp/one_click_script/blob/master/linux_install_software.sh#L1022

@jinwyp
Copy link
Author

jinwyp commented May 12, 2022

已经解决了 是因为www-data用户 对nginx上传使用到 /var/lib/nginx/tmp/client_body 目录没有权限 赋予权限就可以了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant