You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Nick Gearls <ni...@gmail.com> on 2010/06/02 14:05:39 UTC

mod_proxy and chunked encoding

Hello,

Although I can see a lot of problems related to chunked encoding, it is 
not clear to me if it is correctly supported in latests versions.
During tests with 2.2.4, I found the following problem: when the 
back-end sends chunked encoding to an Apache reverse proxy (see below 
for loaded modules), it seems that Apache does not understands it is 
chunked encoded (although the header is present), and sends the complete 
packet with the chunks length as part of the (non chunked encoded) message.

When suppressing the chunked encoding (by forcing HTTP 1.0 with "setenv 
force-proxy-request-1.0"), it works smoothly.
Is this supposed to be one of the known bugs - I don't see corresponding 
one (no mod_filter, mod_deflate, etc.)?

Details:
--------- Answer from the back-end ---------
HTTP/1.1 200 OK
Date: Tue, 01 Jun 2010 12:01:23 GMT
Server: ***back-end******
Content-Type: text/html; charset=utf-8
Content-Length: 28903
Transfer-Encoding: chunked
Connection: close

70d9




<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" 
"http://www.w3.org/TR/html4/loose.dtd">
…
</body>
</html>

0
--------- Answer from the reverse proxy ---------
HTTP/1.1 200 OK
Date: Tue, 01 Jun 2010 12:01:23 GMT
Server: ***front-end******
Content-Type: text/html; charset=utf-8
Vary: Accept-Encoding,User-Agent
Content-Length: 28903
Connection: close

70d9




<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" 
"http://www.w3.org/TR/html4/loose.dtd">
…
</body>
</html>

0
---------

Relevant loaded modules:

    * mod_rewrite
    * mod_substitute
    * mod_include
    * mod_proxy
    * mod_proxy_http

Regards,

Nick


Re: mod_proxy and chunked encoding

Posted by Sergey Chernyshev <se...@gmail.com>.
Not sure if helps, but I had similar experience with nginx - what
happened to me is that proxy did not understand chunked encoding, and
double-encoded the content so browsers treated original chunk markers
as content after decoding proxy's markers.

On Wednesday, June 2, 2010, Nick Gearls  wrote:
> Hello,
>
> Although I can see a lot of problems related to chunked encoding, it is not clear to me if it is correctly supported in latests versions.
> During tests with 2.2.4, I found the following problem: when the back-end sends chunked encoding to an Apache reverse proxy (see below for loaded modules), it seems that Apache does not understands it is chunked encoded (although the header is present), and sends the complete packet with the chunks length as part of the (non chunked encoded) message.
>
> When suppressing the chunked encoding (by forcing HTTP 1.0 with "setenv force-proxy-request-1.0"), it works smoothly.
> Is this supposed to be one of the known bugs - I don't see corresponding one (no mod_filter, mod_deflate, etc.)?
>
> Details:
> --------- Answer from the back-end ---------
> HTTP/1.1 200 OK
> Date: Tue, 01 Jun 2010 12:01:23 GMT
> Server: ***back-end******
> Content-Type: text/html; charset=utf-8
> Content-Length: 28903
> Transfer-Encoding: chunked
> Connection: close
>
> 70d9
>
>
>
>
> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
> …
>
>
>
> 0
> --------- Answer from the reverse proxy ---------
> HTTP/1.1 200 OK
> Date: Tue, 01 Jun 2010 12:01:23 GMT
> Server: ***front-end******
> Content-Type: text/html; charset=utf-8
> Vary: Accept-Encoding,User-Agent
> Content-Length: 28903
> Connection: close
>
> 70d9
>
>
>
>
> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
> …
>
>
>
> 0
> ---------
>
> Relevant loaded modules:
>
>    * mod_rewrite
>    * mod_substitute
>    * mod_include
>    * mod_proxy
>    * mod_proxy_http
>
> Regards,
>
> Nick
>
>

-- 

Thank you,

         Sergey


--
Sergey Chernyshev
http://www.sergeychernyshev.com/

RE: mod_proxy and chunked encoding

Posted by "Plüm, Rüdiger, VF-Group" <ru...@vodafone.com>.
 

> -----Original Message-----
> From: Nick Gearls 
> Sent: Mittwoch, 2. Juni 2010 14:06
> To: Development Apache
> Subject: mod_proxy and chunked encoding
> 
> Hello,
> 
> Although I can see a lot of problems related to chunked 
> encoding, it is 
> not clear to me if it is correctly supported in latests versions.
> During tests with 2.2.4, I found the following problem: when the

2.2.4 is fairly old. Have you tried with a more recent version?

Regards

Rüdiger