Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

upstream prematurely closed connection while reading response header from upstream, client

I'm getting this error from /var/log/messages on my FreeBSD box. I'm using nginx and spawn-fcgi with memcache and apc modules enabled.

upstream prematurely closed connection while reading response header from upstream, 
client HTTP/1.1", upstream: "fastcgi://unix:/tmp/fcgi.sock:", host:
like image 585
Harikrishnan Avatar asked Jan 07 '13 10:01

Harikrishnan


1 Answers

I've had a similar error with unicorn + nginx.

The end result was that the unicorn was timing out due to a firewall misconfiguration, dieing off and leaving NGINX clueless as to what to do (nginx would then throw a 503).

Once the port was open my issue was resolved.

I've also seen this happen with an API call that takes a long time (longer than my 30s unicorn timeout). I ended up shipping it off to a background job so the unicorn didn't timeout.

like image 140
ryanjones Avatar answered Oct 09 '22 15:10

ryanjones