turning off Transfer-Encoding: chunked from nginx push stream response?

2,461 views
Skip to first unread message

Ethan Wang

unread,
Dec 2, 2012, 5:01:04 PM12/2/12
to nginxpu...@googlegroups.com
Is it possible to instead of receiving the push stream response in a chunked encoding format, e.g:

HTTP/1.1 200 OK\r\n
...
\r\n
[chunk length]\r\n
[chunk]
\r\n
[chunk length]\r\n
[chunk]
\r\n
...

and instead get response in the format of:

HTTP/1.1 200 OK\r\n
...
Content-Length: [chunk length]\r\n
...
\r\n
[chunk]
HTTP/1.1 200 OK\r\n
...
Content-Length: [chunk length]\r\n
...
\r\n
[chunk length]\r\n
[chunk]
\r\n
...

e.g. in the series of HTTP objects with Content-Length over the same TCP connection? This is desirable as some web proxy out there do not always correctly implement chunked encoding and may be able to deal with HTTP responses with explicit Content-Length set.

thank you!

Ethan.

Ethan Wang

unread,
Dec 2, 2012, 5:03:52 PM12/2/12
to nginxpu...@googlegroups.com
Answered my own question, add this to your config:

            chunked_transfer_encoding       off;

Ethan Wang

unread,
Dec 2, 2012, 5:22:20 PM12/2/12
to nginxpu...@googlegroups.com
I take that back --- I was confused by a different TCP connection via tcpdump. 

Setting chunked_transfer_encoding to 'off' has no effect. It would appear the http push stream module always uses chunked encoding?

Wandenberg Peixoto

unread,
Jan 6, 2013, 5:55:23 PM1/6/13
to nginxpu...@googlegroups.com
Hi Ethan,

sorry for the very late response.
There is no way of turning off the chunked encoding.
This is the specified way of send content when you don't know the content size.
Any modern web proxy which supports http 1.1 version will work fine with the module.

Regards,
Wandenberg
Reply all
Reply to author
Forward
0 new messages