Remember to specify nginx’s temp directory path

 

I catched this error in my log:

2010/11/20 12:38:22 [crit] 792#0: *58342 open() “/usr/local/fastcgi_temp/2/23/0000002309″ failed (13: Permission denied) while reading upstream, client: XXX.XXX.XXX.XXX, server: xxx.host.com, request: “GET /page.php”, upstream: “http://0.0.0.0/dir/page.php”, host: “lamnk.com”, referrer: “http://referrer.com/”

fastcgi_temp should in no way belong to /usr/local. It’s clear that if you forget to set configuration flags, nginx will set the path to prefix‘s path during compilation. Run ./configure --help show:

% ./configure --help | grep -e "temp-path"
--http-client-body-temp-path=PATH set path to the http client request body
--http-proxy-temp-path=PATH set path to the http proxy temporary files
--http-fastcgi-temp-path=PATH set path to the http fastcgi temporary
--http-uwsgi-temp-path=PATH set path to the http uwsgi temporary files
--http-scgi-temp-path=PATH set path to the http scgi temporary files

On my system they go to /var/tmp/nginx according to CentOS file system structure.

Related posts: