Nginx + fastcgi truncation problem Nginx + fastcgi truncation problem django django

Nginx + fastcgi truncation problem


I had the same exact problem running Nagios on nginx. I stumbled upon your question while googling for an answer, and reading "permission denied" related answers it struck me (and perhaps it will help you) :

  • Nginx error.log was reporting :

    2011/03/07 11:36:02 [crit] 30977#0: *225952 open() "/var/lib/nginx/fastcgi/2/65/0000002652" failed (13: Permission denied)

  • so I just ran # chown -R www-data:www-data /var/lib/nginx/fastcgi

  • Fixed ! (and thank you for your indirect help)


Check your error logs for "Permission denied" errors writing to .../nginx/tmp/... files. Nginx will work fine unless it needs temporary space, and that typically happens at 32K boundaries. If you find these errors, make sure the tmp directory is writable by the user nginx runs as.


What fastcgi interface are you using and how. Is it flup? If yes, paste the way you spawn the server and how it's hooked into nginx. Without that information it's just guessing what could go wrong.

Possible problems:

  • nginx is buggy. At least lighttpd has horrible fastcgi bugs, I wouldn't wonder if nginx has some too :)
  • Django is dying with a traceback in an internal system that is not properly catched and closes the fastcgi server which you can't see from the client. In that situation wrap the fastcgi server application call and try/except it to print the exception.

But server log and config would be great.