I have a lot of this NGINX error on several EC2 instances:

2016/10/28 15:50:46 [error] 2879#0: *31351 upstream timed out (110: Connection timed out) while reading response header from upstream, client:, server: www.myhost.com, request: "POST /someurl HTTP/1.1", upstream: "fastcgi://unix:/var/run/php/php7.0-fpm.sock", host: "www.myhost.com", referrer: "https://www.myhost.com/other-url"

I don't know where investigate... Nginx ? AWS ?


I'd also look into the fastcgi_read_timeout option.

fastcgi_read_timeout 150; (for example) in your nginx configuration block which could start with:

location ~* .php$ {...


'upstream' is timing out (default timeout is 60 seconds I think)

In this case 'upstream' is your fastcgi... upstream: "fastcgi://unix:/var/run/php/php7.0-fpm.sock"

Investigate your php process...


Your PHP application is taking too long to process that particular request.

You need to study the PHP application code to see why the requests lasts so long and then try to make it faster.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.