How to Fix “upstream timed out (110: Connection timed out) while reading response header from upstream” in NGINX

Problem :

I noticed there are the errors in NGINX when trying to update my WordPress post. In my case, NGINX service running as web service with php-fpm behind varnish proxy :

[root@vps ~]# tail -f /var/log/nginx/ehowstuff.com.error.log
2014/12/14 15:33:15 [error] 1040#0: *52134 upstream timed out (110: Connection timed out) while reading response header from upstream, client: 127.0.0.1

Solution :

This is how i resolved my issue. I have added the following lines to /etc/nginx/nginx.conf

location ~ .php$ {
..
..
    fastcgi_send_timeout 150s;
    fastcgi_read_timeout 150s;
..
..
}

Then restart nginx service :

/etc/init.d/nginx restart

or

service nginx restart
Leave a Reply

Your email address will not be published. Required fields are marked *

SiteGround.com

A world leading hosting company that provides fully-managed innovative and secure solutions, suitable for hosting small to medium-sized websites

Built on the best available technologies combined with Google Cloud for strong redundancy and application availability. Backed by skilled experts to address web security threats, a devops team to create advanced custom security solutions, and 24/7 sysadmins to watch over the platform. This powerful, hands-on approach makes your sites faster, safer, and easier to manage. Starting from only $3.95/mo.

TRY FREE

* up to 30 days money back guarantee