Nginx错误 open() "/usr/local/nginx/proxy_temp/x/xx/xxxxxxxx" failed (13: Permission denied) while reading upstream解决办法

问题:设置client_max_body不起作用(not wroking)

发现: nginx error.log中有 open() "/usr/local/nginx/proxy_temp/x/xx/xxxxxxxx" failed (13: Permission denied) while reading upstream

解决办法:

首先查看 ps aux | grep "nginx: worker process"当前nginx的用户是谁:如 nginx

然后查看 ll //usr/local/nginx/proxy_temp文件夹下文件&&文件夹的用户,大概率会发现里面文件&文件夹权限为root等启动nginx的用户无权限的文件&文件夹

最后更改文件或文件夹所属用户&组 chown -R nginx:nginx /usr/local/nginx/

重启nginx即可

 

posted @ 2024-02-06 10:12  cnkker.com  阅读(60)  评论(0编辑  收藏  举报