nginx 500 error, permission denied for tmp folder

2020-03-05 03:47发布

问题:

I got 500 from Django admin, when I tried to upload a photo.

When I inspect the error.log I found:

2014/03/13 23:00:55 [crit] 16478#0: *24 open() "/var/lib/nginx/tmp/client_body/0000000012" failed (13: Permission denied), client: xxxxxxx.xxx, server: xxxxxxx.xxx, request: "POST xxxxxxx.xxx/item/86/ HTTP/1.1", host: "xxxxxxx.xxx", referrer: "http://xxxxxxx.xxx/item/86/"
------------------------------------------------------------------------

What could be wrong here?

回答1:

Phew. Solved. As the error message says, this indeed was just a "Permission" issue.

Check through "/var/lib/nginx/tmp/client_body/" and make sure the permission is correct at each directory level solve the issue.

More details can be found here : http://derekneely.com/2009/06/nginx-failed-13-permission-denied-while-reading-upstream/ and here : Permission Denied error with Django while uploading a file