# Urgent help - 145: Connection timed out

**URL:** <https://www.ruby-forum.com/t/urgent-help-145-connection-timed-out/175654>\
**Category:** NGINX\
**Created:** [September 17, 2009, 6:26am UTC](https://www.ruby-forum.com/t/urgent-help-145-connection-timed-out/175654 "2009-09-17T06:26:24Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kevin\_Castiglione](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/ecd19e/32.png) [@Kevin\_Castiglione](https://www.ruby-forum.com/u/Kevin_Castiglione)\
**Post date:** [September 17, 2009, 6:26am UTC](https://www.ruby-forum.com/t/urgent-help-145-connection-timed-out/175654/1 "2009-09-17T06:26:24Z")

</div>

hi  
i have the nginx config below, and the fascgi backend takes lot of time  
to  
process the request. this is expected. but nginx returns error before it  
is  
over:

upstream timed out (145: Connection timed out) while reading response  
header from upstream, client: X.X.X.119, server: [YYY.com](http://YYY.com), request: “POST  
/  
HTTP/1.1”, upstream: “fastcgi://A.B.C.D:8492”, host: “[AAA.YYY.com](http://AAA.YYY.com)”,  
referrer: "[http://xx.y.com/](http://xx.y.com/)

can you tell me what config i should change/ increase so that nginx  
waits  
for some more time before returning this error.  
thanks a lot!

```
upstream backend_XX{
    server A.B.C.D:8492 fail_timeout=1s;
}
server {
    server_name AAA.YYY.com;
    include nginx_listen.conf;
    access_log logs/access.log;

    client_max_body_size 10m;

    location / {
        root /home/mark/XX;

        fastcgi_pass backend_XX;

        fastcgi_param SCRIPT_NAME $host$fastcgi_script_name;
        fastcgi_param SCRIPT_FILENAME /$host$fastcgi_script_name;
        fastcgi_param PATH_INFO /$host$fastcgi_script_name;
        fastcgi_param QUERY_STRING $query_string;
        fastcgi_param CONTENT_TYPE $content_type;
        fastcgi_param CONTENT_LENGTH $content_length;
        fastcgi_param REQUEST_METHOD $request_method;
        fastcgi_param REMOTE_ADDR $remote_addr;
        fastcgi_param REMOTE_PORT $remote_port;
        fastcgi_param SERVER_PROTOCOL $server_protocol;
        fastcgi_param SERVER_ADDR $server_addr;
        fastcgi_param SERVER_PORT $server_port;
        fastcgi_param SERVER_NAME $server_name;
    }
}

```

---

<div class="post-metadata">

**Author:** ![Kevin\_Castiglione](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/ecd19e/32.png) [@Kevin\_Castiglione](https://www.ruby-forum.com/u/Kevin_Castiglione)\
**Post date:** [September 17, 2009, 7:15am UTC](https://www.ruby-forum.com/t/urgent-help-145-connection-timed-out/175654/2 "2009-09-17T07:15:35Z")

</div>

On Wed, Sep 16, 2009 at 09:11:08PM -0700, Kevin Castiglione wrote:

> can you tell me what config i should change/ increase so that nginx waits  
> for some more time before returning this error.  
> thanks a lot!

fastcgi\_read\_timeout 2m; # default is 60s

---

<div class="post-metadata">

**Author:** ![Kevin\_Castiglione](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/ecd19e/32.png) [@Kevin\_Castiglione](https://www.ruby-forum.com/u/Kevin_Castiglione)\
**Post date:** [September 17, 2009, 8:45am UTC](https://www.ruby-forum.com/t/urgent-help-145-connection-timed-out/175654/3 "2009-09-17T08:45:08Z")

</div>

2009/9/16 Igor S. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

> > header from upstream, client: X.X.X.119, server: [YYY.com](http://YYY.com), request: "POST  
> > fastcgi\_read\_timeout 2m; # default is 60s
> 
> thanks a lot for this! inorder for me to tune this to the value i want, i  
> want to be able to add the request time to the error log.  
> how do i add the request\_time to the default error log format?

thanks a lot!
