# "client closed prematurely connection..."

**URL:** <https://www.ruby-forum.com/t/client-closed-prematurely-connection/119321>\
**Category:** NGINX\
**Created:** [November 6, 2007, 12:58am UTC](https://www.ruby-forum.com/t/client-closed-prematurely-connection/119321 "2007-11-06T00:58:59Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![aroth](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/5f8ce5/32.png) [@aroth](https://www.ruby-forum.com/u/aroth)\
**Post date:** [November 6, 2007, 12:58am UTC](https://www.ruby-forum.com/t/client-closed-prematurely-connection/119321/1 "2007-11-06T00:58:59Z")

</div>

About 15% of my requests are hanging and the nginx error log outputs:

\*5 client closed prematurely connection, so upstream connection is  
closed too while sending request to upstream

At this point I’m not sure what the problem is. Nginx? Mongrel? Some  
code causing Rails to quit? Any ideas?

---

<div class="post-metadata">

**Author:** ![aroth](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/5f8ce5/32.png) [@aroth](https://www.ruby-forum.com/u/aroth)\
**Post date:** [November 8, 2007, 5:32am UTC](https://www.ruby-forum.com/t/client-closed-prematurely-connection/119321/2 "2007-11-08T05:32:50Z")

</div>

On Nov 5, 2007 6:58 PM, Adam R. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> About 15% of my requests are hanging and the nginx error log outputs:
> 
> \*5 client closed prematurely connection, so upstream connection is  
> closed too while sending request to upstream
> 
> At this point I’m not sure what the problem is. Nginx? Mongrel? Some  
> code causing Rails to quit? Any ideas?

It is possible that the Mongrels are getting more requests than they  
can handle in which case they simply close the connection. I’m not  
saying this is what is happening but you should make sure that you  
have enough running to handle the load. Other than that I am unsure.

Good luck,

~Wayne

---

<div class="post-metadata">

**Author:** ![aroth](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/5f8ce5/32.png) [@aroth](https://www.ruby-forum.com/u/aroth)\
**Post date:** [November 8, 2007, 4:33pm UTC](https://www.ruby-forum.com/t/client-closed-prematurely-connection/119321/3 "2007-11-08T16:33:23Z")

</div>

On Tue, Nov 06, 2007 at 12:58:59AM +0100, Adam R. wrote:

> About 15% of my requests are hanging and the nginx error log outputs:
> 
> \*5 client closed prematurely connection, so upstream connection is  
> closed too while sending request to upstream
> 
> At this point I’m not sure what the problem is. Nginx? Mongrel? Some  
> code causing Rails to quit? Any ideas?

You see the hanging requests in browser ? Try

proxy\_ignore\_client\_abort on;  
fastcgi\_ignore\_client\_abort on;

---

<div class="post-metadata">

**Author:** ![aroth](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/5f8ce5/32.png) [@aroth](https://www.ruby-forum.com/u/aroth)\
**Post date:** [November 14, 2007, 11:17am UTC](https://www.ruby-forum.com/t/client-closed-prematurely-connection/119321/4 "2007-11-14T11:17:07Z")

</div>

Igor S. a e’crit :

> > 
> 
> You see the hanging requests in browser ? Try
> 
> proxy\_ignore\_client\_abort on;  
> fastcgi\_ignore\_client\_abort on;

Hello,  
Can you be more specific on this options ? There isn’t any description  
in the english documentation.

Does it prevent aborting request to upstream proxys and fastcgis in case  
the client itself aborts the request ?

---

<div class="post-metadata">

**Author:** ![aroth](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/5f8ce5/32.png) [@aroth](https://www.ruby-forum.com/u/aroth)\
**Post date:** [November 14, 2007, 11:41am UTC](https://www.ruby-forum.com/t/client-closed-prematurely-connection/119321/5 "2007-11-14T11:41:10Z")

</div>

On Wed, Nov 14, 2007 at 11:03:24AM +0100, Jean-Philippe wrote:

> > > code causing Rails to quit? Any ideas?  
> > > Can you be more specific on this options ? There isn’t any description  
> > > in the english documentation.
> 
> Does it prevent aborting request to upstream proxys and fastcgis in case  
> the client itself aborts the request ?

Yes.

---

<div class="post-metadata">

**Author:** ![aroth](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/5f8ce5/32.png) [@aroth](https://www.ruby-forum.com/u/aroth)\
**Post date:** [November 14, 2007, 12:36pm UTC](https://www.ruby-forum.com/t/client-closed-prematurely-connection/119321/6 "2007-11-14T12:36:14Z")

</div>

Igor S. a e’crit :

> > > > 
> > > 
> > > fastcgi\_ignore\_client\_abort on;
> 
> Yes.

Thanks, I’ll add it to the documentation.
