# Nginx adds extra chunked header while proxying anytermd

**URL:** <https://www.ruby-forum.com/t/nginx-adds-extra-chunked-header-while-proxying-anytermd/137120>\
**Category:** NGINX\
**Created:** [May 9, 2008, 3:08am UTC](https://www.ruby-forum.com/t/nginx-adds-extra-chunked-header-while-proxying-anytermd/137120 "2008-05-09T03:08:05Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![san](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/ba9def/32.png) [@san](https://www.ruby-forum.com/u/san)\
**Post date:** [May 9, 2008, 3:08am UTC](https://www.ruby-forum.com/t/nginx-adds-extra-chunked-header-while-proxying-anytermd/137120/1 "2008-05-09T03:08:05Z")

</div>

Hi guys,

I have a problem while using nginx to proxy anytermd. anytermd is a  
simple  
web server which always outputs chunked  
data. The following is the data that nginx gave to me:

HTTP/1.1 200 OK  
Server: nginx/0.5.36  
Date: Fri, 09 May 2008 00:30:37 GMT  
Content-Type: text/html  
Transfer-Encoding: chunked  
Connection: close  
Transfer-Encoding: chunked

75f  
753

…  
0

0

I saw the doc said that nginx talks http/1.0 to the backend server.How  
can I  
let the nginx outputing the original data?

---

<div class="post-metadata">

**Author:** ![san](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/ba9def/32.png) [@san](https://www.ruby-forum.com/u/san)\
**Post date:** [May 9, 2008, 10:00am UTC](https://www.ruby-forum.com/t/nginx-adds-extra-chunked-header-while-proxying-anytermd/137120/2 "2008-05-09T10:00:52Z")

</div>

On Fri, May 09, 2008 at 08:55:46AM +0800, san wrote:

> Transfer-Encoding: chunked  
> I saw the doc said that nginx talks http/1.0 to the backend server.How can I  
> let the nginx outputing the original data?

It’s bug in anytermd. It must not send a chunked response for http/1.0  
request:  
a http/1.0 client does not understand this encoding.

---

<div class="post-metadata">

**Author:** ![san](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/ba9def/32.png) [@san](https://www.ruby-forum.com/u/san)\
**Post date:** [May 9, 2008, 11:47am UTC](https://www.ruby-forum.com/t/nginx-adds-extra-chunked-header-while-proxying-anytermd/137120/3 "2008-05-09T11:47:50Z")

</div>

Thanks for your reply. Could you give me a  
hint that I can modify the nginx source code to let nginx outputs the  
original data?

---

<div class="post-metadata">

**Author:** ![san](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/ba9def/32.png) [@san](https://www.ruby-forum.com/u/san)\
**Post date:** [August 20, 2008, 6:36am UTC](https://www.ruby-forum.com/t/nginx-adds-extra-chunked-header-while-proxying-anytermd/137120/4 "2008-08-20T06:36:07Z")

</div>

Dear Igor,

I am suffering from this problem as well, but I am installing nginx from  
FreeBSD ports and would not like to mess with its setting.

My question is will this patch make in to the main Nginx release, or  
not?

Igor S. wrote:

> On Fri, May 09, 2008 at 05:39:39PM +0800, san wrote:
> 
> > Thanks for your reply. Could you give me a  
> > hint that I can modify the nginx source code to let nginx outputs the  
> > original data?
> 
> Try the attached patch: it disables nginx’s chunked response if backend  
> already sends it chunked.

---

<div class="post-metadata">

**Author:** ![san](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/ba9def/32.png) [@san](https://www.ruby-forum.com/u/san)\
**Post date:** [May 10, 2008, 1:15pm UTC](https://www.ruby-forum.com/t/nginx-adds-extra-chunked-header-while-proxying-anytermd/137120/5 "2008-05-10T13:15:03Z")

</div>

On Fri, May 09, 2008 at 05:39:39PM +0800, san wrote:

> Thanks for your reply. Could you give me a  
> hint that I can modify the nginx source code to let nginx outputs the  
> original data?

Try the attached patch: it disables nginx’s chunked response if backend  
already sends it chunked.

---

<div class="post-metadata">

**Author:** ![san](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/ba9def/32.png) [@san](https://www.ruby-forum.com/u/san)\
**Post date:** [September 23, 2009, 7:25pm UTC](https://www.ruby-forum.com/t/nginx-adds-extra-chunked-header-while-proxying-anytermd/137120/6 "2009-09-23T19:25:52Z")

</div>

Igor S. wrote:

> On Wed, Aug 20, 2008 at 06:36:07AM +0200, Sharkie L. wrote:
> 
> > I am suffering from this problem as well, but I am installing nginx from  
> > FreeBSD ports and would not like to mess with its setting.
> > 
> > My question is will this patch make in to the main Nginx release, or  
> > not?
> 
> No, that patch had not been commited.
> 
> Actually this is Glassfish bug: it must not send chunked response  
> for HTTP/1.0 request.

Hi Igor,

This is a workaround ? I have the same issue.

I am using nginx 0.7.62 and I not seeing this patch applied.

What can I do ?

Regards,

Camilo Aguilar

---

<div class="post-metadata">

**Author:** ![san](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/ba9def/32.png) [@san](https://www.ruby-forum.com/u/san)\
**Post date:** [August 21, 2008, 3:24pm UTC](https://www.ruby-forum.com/t/nginx-adds-extra-chunked-header-while-proxying-anytermd/137120/7 "2008-08-21T15:24:16Z")

</div>

On Wed, Aug 20, 2008 at 06:36:07AM +0200, Sharkie L. wrote:

> I am suffering from this problem as well, but I am installing nginx from  
> FreeBSD ports and would not like to mess with its setting.
> 
> My question is will this patch make in to the main Nginx release, or  
> not?

No, that patch had not been commited.

Actually this is Glassfish bug: it must not send chunked response  
for HTTP/1.0 request.

---

<div class="post-metadata">

**Author:** ![san](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/ba9def/32.png) [@san](https://www.ruby-forum.com/u/san)\
**Post date:** [September 23, 2009, 7:59pm UTC](https://www.ruby-forum.com/t/nginx-adds-extra-chunked-header-while-proxying-anytermd/137120/8 "2009-09-23T19:59:19Z")

</div>

Camilo Aguilar wrote:

> Igor S. wrote:
> 
> > On Wed, Aug 20, 2008 at 06:36:07AM +0200, Sharkie L. wrote:
> > 
> > > I am suffering from this problem as well, but I am installing nginx from  
> > > FreeBSD ports and would not like to mess with its setting.
> > > 
> > > My question is will this patch make in to the main Nginx release, or  
> > > not?
> > 
> > No, that patch had not been commited.

My backend is Mule ESB, it uses Jetty application server
