# 502 & 504 error, again

**URL:** <https://www.ruby-forum.com/t/502-504-error-again/215370>\
**Category:** NGINX\
**Created:** [January 2, 2012, 5:38am UTC](https://www.ruby-forum.com/t/502-504-error-again/215370 "2012-01-02T05:38:21Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![dubstep](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/cdc98d/32.png) [@dubstep](https://www.ruby-forum.com/u/dubstep)\
**Post date:** [January 2, 2012, 5:38am UTC](https://www.ruby-forum.com/t/502-504-error-again/215370/1 "2012-01-02T05:38:21Z")

</div>

I know it should be a well-known issue.  
I searched and try to find out what on earth it is, but I failed.

Step:

1. nginx works as reverse proxy and the version is V1.0.5,  
OS: Debian 5.0.3, Kernel Version 2.6.32

2. Enabled http 1.1, 504 error is popup in client;  
the error log indicates:

* * *

## 2011/12/30 09:40:06 [error] 11013#0: \*1 upstream timed out (110: Connection timed out) while reading response header from upstream, client: 10.208.127.142, server: 1.1.1.1, request: “POST /QueryStatManage/StatStudentAction.aspx HTTP/1.1”, upstream: " [http://1.1.1.1:80/QueryStatManage/StatStudentAction.aspx](http://1.1.1.1:80/QueryStatManage/StatStudentAction.aspx)", host: “1.1.1.1”, referrer: “[http://1.1.1.1/QueryStatManage/StatStudentAction.aspx](http://1.1.1.1/QueryStatManage/StatStudentAction.aspx)”

1. increase the vaule

* * *

2011/12/30 09:53:54 [error] 11173#0: \*1 upstream prematurely closed  
connection while reading response header from upstream, client:  
10.208.127.142, server: 1.1.1.1, request: “POST  
/QueryStatManage/StatStudentAction.aspx HTTP/1.1”, upstream: "  
[http://1.1.1.1:80/QueryStatManage/StatStudentAction.aspx](http://1.1.1.1:80/QueryStatManage/StatStudentAction.aspx)", host:  
“1.1.1.1”,  
referrer: “[http://1.1.1.1/QueryStatManage/StatStudentAction.aspx](http://1.1.1.1/QueryStatManage/StatStudentAction.aspx)”

1. Someone told me that there is a kernel bug in linux, I am not sure,  
can  
someone see the same issue ?

thanks  
George

---

<div class="post-metadata">

**Author:** ![Geoge.Q](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/e9c0ed/32.png) [@Geoge.Q](https://www.ruby-forum.com/u/Geoge.Q)\
**Post date:** [January 3, 2012, 12:55am UTC](https://www.ruby-forum.com/t/502-504-error-again/215370/2 "2012-01-03T00:55:05Z")

</div>

Hello!

On Mon, Jan 02, 2012 at 12:37:36PM +0800, Geoge.Q wrote:

> ## 2011/12/30 09:40:06 [error] 11013#0: \*1 upstream timed out (110: Connection timed out) while reading response header from upstream, client: 10.208.127.142, server: 1.1.1.1, request: “POST /QueryStatManage/StatStudentAction.aspx HTTP/1.1”, upstream: " [http://1.1.1.1:80/QueryStatManage/StatStudentAction.aspx](http://1.1.1.1:80/QueryStatManage/StatStudentAction.aspx)", host: “1.1.1.1”, referrer: “[http://1.1.1.1/QueryStatManage/StatStudentAction.aspx](http://1.1.1.1/QueryStatManage/StatStudentAction.aspx)”

The “upstream” and “server” seems to be the same, so it looks  
like you’ve created an infinite proxy loop.

Maxim D.

---

<div class="post-metadata">

**Author:** ![Geoge.Q](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/e9c0ed/32.png) [@Geoge.Q](https://www.ruby-forum.com/u/Geoge.Q)\
**Post date:** [January 3, 2012, 1:38pm UTC](https://www.ruby-forum.com/t/502-504-error-again/215370/3 "2012-01-03T13:38:07Z")

</div>

thanks Max. I will check and update you.

George

---

<div class="post-metadata">

**Author:** ![Geoge.Q](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/e9c0ed/32.png) [@Geoge.Q](https://www.ruby-forum.com/u/Geoge.Q)\
**Post date:** [January 3, 2012, 3:45pm UTC](https://www.ruby-forum.com/t/502-504-error-again/215370/4 "2012-01-03T15:45:59Z")

</div>

On Sun, Jan 1, 2012 at 11:37 PM, Geoge.Q [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> I know it should be a well-known issue.  
> I searched and try to find out what on earth it is, but I failed.
> 
> Step:
> 
> 1. nginx works as reverse proxy and the version is V1.0.5,  
> OS: Debian 5.0.3, Kernel Version 2.6.32
> 
> 2. Enabled http 1.1, 504 error is popup in client;

You enabled the HTTP/1.1 protocol? Where? What were you doing before?

> ## the error log indicates:
> 
> ## 2011/12/30 09:40:06 [error] 11013#0: \*1 upstream timed out (110: Connection timed out) while reading response header from upstream, client: 10.208.127.142, server: 1.1.1.1, request: “POST /QueryStatManage/StatStudentAction.aspx HTTP/1.1”, upstream: “[http://1.1.1.1:80/QueryStatManage/StatStudentAction.aspx](http://1.1.1.1:80/QueryStatManage/StatStudentAction.aspx)”, host: “1.1.1.1”, referrer: “[http://1.1.1.1/QueryStatManage/StatStudentAction.aspx](http://1.1.1.1/QueryStatManage/StatStudentAction.aspx)”

How large is the POST?

> /QueryStatManage/StatStudentAction.aspx HTTP/1.1", upstream:  
> “[http://1.1.1.1:80/QueryStatManage/StatStudentAction.aspx](http://1.1.1.1:80/QueryStatManage/StatStudentAction.aspx)”, host: “1.1.1.1”,  
> referrer: “[http://1.1.1.1/QueryStatManage/StatStudentAction.aspx](http://1.1.1.1/QueryStatManage/StatStudentAction.aspx)”

Does the back end application work without nginx as proxy? What is the  
nginx configuration? We need details to help you.

> 1. Someone told me that there is a kernel bug in linux, I am not sure, can  
> someone see the same issue ?

Irrelevant. These are HTTP errors, with HTTP logging. If you have  
kernel errors, send your logs to the appropriate maintainers 🙂

You are running an [ASP.NET](http://ASP.NET) application. You have to correctly set  
proxy timeouts and buffer sizes to proxy to ASP applications, assuming  
the application works.

Stefan C.

> **[ScaleEngine is the Technical Video Streaming CDN Delivering Perfect Streams...](https://www.scaleengine.com/contact)**
>
> Video CDN, streaming live and on demand securely and reliably. Perfect streams to the world with our developer API, exact usage billing, and direct support
