Ebb and Transfer-Encoding: chunked

Maxim Dounin mdounin at mdounin.ru
Sat Nov 22 14:28:46 MSK 2008


Hello!

On Sat, Nov 22, 2008 at 01:06:03AM +0100, John Miller wrote:

> While I bet it is not encountered too often, there is a bug existing
> between NginX and Ebb.  Most frameworks (Rails, Merb, Sinatra,
> others?...)  pass a string as the final(body) element of their Rack
> response.  Rack merely requires that the body respond to :each by
> yielding strings.  When and array (or something more complex) is passed
> to Ebb as the body, it sets 'Transfer-Encoding: chunked' and then sends
> each yielded value as a chuck.
> 
> NginX speaks to its back end services using HTTP/1.0 which does not
> include Transfer-Encoding.  It therefore adds it's own transfer encoding
> and life becomes very messy.
> 
> To fix this, there is a patch in this thread:
> http://www.ruby-forum.com/topic/152435?reply_to=717744#672279
> 
> Thanks to Igor for the patch.  I hope this can save someone else an
> afternoon of fiddling.

Just to make things clear:

1. Root of the problem is backend (Ebb in this case) violating 
http specs.

2. The patch in question will resolve only part of the problems 
that arise as a result.  You should still expect wierd things to 
happen when using proxy_store, gzipping such replies, using ssi on 
them and so on.

Maxim Dounin





More information about the nginx mailing list