# Timeout error

**URL:** <https://www.ruby-forum.com/t/timeout-error/223173>\
**Category:** NGINX\
**Created:** [September 25, 2012, 5:29am UTC](https://www.ruby-forum.com/t/timeout-error/223173 "2012-09-25T05:29:37Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![aris](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/258eb7/32.png) [@aris](https://www.ruby-forum.com/u/aris)\
**Post date:** [September 25, 2012, 5:29am UTC](https://www.ruby-forum.com/t/timeout-error/223173/1 "2012-09-25T05:29:37Z")

</div>

I’ve looked through the docs and cant seem to nail down what I need to  
do in order to solve this problem.

When making a request to my nginx server, occasionally the request is  
for something that takes a long time (in this case I’m running a select  
statement that could take many, many hours).

How do I get nginx to not timeout after only 60 seconds? Is there a way  
that I can set the timeout to an unlimited amount of time? Would I do  
this in the nginx.conf file or in the sites-enabled/default file?

This is an example of the error I get when I’m trying to request a query  
that takes a long time:

2012/09/24 19:21:23 [error] 6996#0: \*20639 upstream timed out (110:  
Connection timed out) while reading response header from upstream,  
client: 10.0.0.5, server: [www.myhost.com](http://www.myhost.com),

Thanks in advance!

Ryan

---

<div class="post-metadata">

**Author:** ![Ryan\_Hatch](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/c5a1d2/32.png) [@Ryan\_Hatch](https://www.ruby-forum.com/u/Ryan_Hatch)\
**Post date:** [September 25, 2012, 5:34am UTC](https://www.ruby-forum.com/t/timeout-error/223173/2 "2012-09-25T05:34:52Z")

</div>

On Tue, Sep 25, 2012 at 10:29 AM, Ryan Hatch  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> I’ve looked through the docs and cant seem to nail down what I need to do in  
> order to solve this problem.
> 
> When making a request to my nginx server, occasionally the request is for  
> something that takes a long time (in this case I’m running a select statement that  
> could take many, many hours).
> 
> How do I get nginx to not timeout after only 60 seconds? Is there a way that I  
> can set the timeout to an unlimited amount of time? Would I do this in the  
> nginx.conf file or in the sites-enabled/default file?
> 
> This is an example of the error I get when I’m trying to request a query that  
> takes a long time:
> 
> 2012/09/24 19:21:23 [error] 6996#0: \*20639 upstream timed out (110: Connection  
> timed out) while reading response header from upstream, client: 10.0.0.5, server:  
> [www.myhost.com](http://www.myhost.com),

Have you checked proxy\_read\_timeout or fastcgi\_read\_timeout?

> **[Module ngx\_http\_proxy\_module](http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_read_timeout)**
>
> The ngx\_http\_proxy\_module module allows passing requests to another server.

> **[Module ngx\_http\_fastcgi\_module](http://nginx.org/en/docs/http/ngx_http_fastcgi_module.html#fastcgi_read_timeout)**
>
> The ngx\_http\_fastcgi\_module module allows passing requests to a FastCGI server.
