You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Adelfio D'Angio' <ad...@freemindconsulting.com> on 2008/11/19 09:54:48 UTC

[users@httpd] Problem with mod_proxy and chunked packets

Hi all,

on Apache 2.2.8 I have a problem with mod_proxy in case of chunked packets.
This is my Proxy configuration:
ProxyPass /bld/kernel http://localhost:38315
ProxyPassReverse /bld/kernel http://localhost:38315

I published an "Hello World!" page on another web server running on port 38315 
but when I use Apache (/bld/kernel/hello2) I get this text:
26
Hello World!
0

I used mod_dumpio to debug this problem:

[notice] mod_dumpio: dumpio_in [getline-blocking] 0 readbytes
[notice] mod_dumpio:  dumpio_in (data-HEAP): 33 bytes
[notice] mod_dumpio:  dumpio_in (data-HEAP): GET /bld/kernel/hello2 
HTTP/1.1\r\n
[notice] mod_dumpio: dumpio_in [getline-blocking] 0 readbytes
[notice] mod_dumpio:  dumpio_in (data-HEAP): 17 bytes
[notice] mod_dumpio:  dumpio_in (data-HEAP): Host: localhost\r\n
[notice] mod_dumpio: dumpio_in [getline-blocking] 0 readbytes
[notice] mod_dumpio:  dumpio_in (data-HEAP): 96 bytes
[notice] mod_dumpio:  dumpio_in (data-HEAP): User-Agent: Mozilla/5.0 (X11; U; 
Linux i686; en-US; rv:1.9.0.3) Gecko/2008092416 Firefox/3.0.3\r\n
[notice] mod_dumpio: dumpio_in [getline-blocking] 0 readbytes
[notice] mod_dumpio:  dumpio_in (data-HEAP): 73 bytes
[notice] mod_dumpio:  dumpio_in (data-HEAP): Accept: 
text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8\r\n
[notice] mod_dumpio: dumpio_in [getline-blocking] 0 readbytes
[notice] mod_dumpio:  dumpio_in (data-HEAP): 33 bytes
[notice] mod_dumpio:  dumpio_in (data-HEAP): Accept-Language: 
en-us,en;q=0.5\r\n
[notice] mod_dumpio: dumpio_in [getline-blocking] 0 readbytes
[notice] mod_dumpio:  dumpio_in (data-HEAP): 31 bytes
[notice] mod_dumpio:  dumpio_in (data-HEAP): Accept-Encoding: gzip,deflate\r\n
[notice] mod_dumpio: dumpio_in [getline-blocking] 0 readbytes
[notice] mod_dumpio:  dumpio_in (data-HEAP): 48 bytes
[notice] mod_dumpio:  dumpio_in (data-HEAP): Accept-Charset: 
ISO-8859-1,utf-8;q=0.7,*;q=0.7\r\n
[notice] mod_dumpio: dumpio_in [getline-blocking] 0 readbytes
[notice] mod_dumpio:  dumpio_in (data-HEAP): 17 bytes
[notice] mod_dumpio:  dumpio_in (data-HEAP): Keep-Alive: 300\r\n
[notice] mod_dumpio: dumpio_in [getline-blocking] 0 readbytes
[notice] mod_dumpio:  dumpio_in (data-HEAP): 24 bytes
[notice] mod_dumpio:  dumpio_in (data-HEAP): Connection: keep-alive\r\n
[notice] mod_dumpio: dumpio_in [getline-blocking] 0 readbytes
[notice] mod_dumpio:  dumpio_in (data-HEAP): 2 bytes
[notice] mod_dumpio:  dumpio_in (data-HEAP): \r\n
[notice] mod_dumpio: dumpio_out
[notice] mod_dumpio:  dumpio_out (data-POOL): 22 bytes
[notice] mod_dumpio:  dumpio_out (data-POOL): GET /hello2 HTTP/1.1\r\n
[notice] mod_dumpio:  dumpio_out (data-POOL): 22 bytes
[notice] mod_dumpio:  dumpio_out (data-POOL): Host: localhost:1025\r\n
[notice] mod_dumpio:  dumpio_out (data-POOL): 96 bytes
[notice] mod_dumpio:  dumpio_out (data-POOL): User-Agent: Mozilla/5.0 (X11; U; 
Linux i686; en-US; rv:1.9.0.3) Gecko/2008092416 Firefox/3.0.3\r\n
[notice] mod_dumpio:  dumpio_out (data-POOL): 73 bytes
[notice] mod_dumpio:  dumpio_out (data-POOL): Accept: 
text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8\r\n
[notice] mod_dumpio:  dumpio_out (data-POOL): 33 bytes
[notice] mod_dumpio:  dumpio_out (data-POOL): Accept-Language: 
en-us,en;q=0.5\r\n
[notice] mod_dumpio:  dumpio_out (data-POOL): 31 bytes
[notice] mod_dumpio:  dumpio_out (data-POOL): Accept-Encoding: 
gzip,deflate\r\n
[notice] mod_dumpio:  dumpio_out (data-POOL): 48 bytes
[notice] mod_dumpio:  dumpio_out (data-POOL): Accept-Charset: 
ISO-8859-1,utf-8;q=0.7,*;q=0.7\r\n
[notice] mod_dumpio:  dumpio_out (data-POOL): 28 bytes
[notice] mod_dumpio:  dumpio_out (data-POOL): X-Forwarded-For: 127.0.0.1\r\n
[notice] mod_dumpio:  dumpio_out (data-POOL): 29 bytes
[notice] mod_dumpio:  dumpio_out (data-POOL): X-Forwarded-Host: localhost\r\n
[notice] mod_dumpio:  dumpio_out (data-POOL): 33 bytes
[notice] mod_dumpio:  dumpio_out (data-POOL): X-Forwarded-Server: 
adedan.site\r\n
[notice] mod_dumpio:  dumpio_out (data-POOL): 24 bytes
[notice] mod_dumpio:  dumpio_out (data-POOL): Connection: Keep-Alive\r\n
[notice] mod_dumpio:  dumpio_out (data-IMMORTAL): 2 bytes
[notice] mod_dumpio:  dumpio_out (data-IMMORTAL): \r\n
[notice] mod_dumpio:  dumpio_out (metadata-FLUSH): 0 bytes
[notice] mod_dumpio: dumpio_in [getline-blocking] 0 readbytes
[notice] mod_dumpio:  dumpio_in (data-HEAP): 18 bytes
[notice] mod_dumpio:  dumpio_in (data-HEAP): HTTP/1.1 200  OK\r\n
[notice] mod_dumpio: dumpio_in [getline-blocking] 0 readbytes
[notice] mod_dumpio:  dumpio_in (data-HEAP): 37 bytes
[notice] mod_dumpio:  dumpio_in (data-HEAP): Date: Thu, 13 Nov 2008 11:41:58 
GMT\r\n
[notice] mod_dumpio: dumpio_in [speculative-blocking] 1 readbytes
[notice] mod_dumpio:  dumpio_in (data-HEAP): 1 bytes
[notice] mod_dumpio:  dumpio_in (data-HEAP): C
[notice] mod_dumpio: dumpio_in [getline-blocking] 0 readbytes
[notice] mod_dumpio:  dumpio_in (data-HEAP): 1 bytes
[notice] mod_dumpio:  dumpio_in (data-HEAP): C
[notice] mod_dumpio:  dumpio_in (data-HEAP): 23 bytes
[notice] mod_dumpio:  dumpio_in (data-HEAP): onnection: Keep-Alive\r\n
[notice] mod_dumpio: dumpio_in [speculative-blocking] 1 readbytes
[notice] mod_dumpio:  dumpio_in (data-HEAP): 1 bytes
[notice] mod_dumpio:  dumpio_in (data-HEAP): K
[notice] mod_dumpio: dumpio_in [getline-blocking] 0 readbytes
[notice] mod_dumpio:  dumpio_in (data-HEAP): 1 bytes
[notice] mod_dumpio:  dumpio_in (data-HEAP): K
[notice] mod_dumpio:  dumpio_in (data-HEAP): 23 bytes
[notice] mod_dumpio:  dumpio_in (data-HEAP): eep-Alive: timeout=20\r\n
[notice] mod_dumpio: dumpio_in [speculative-blocking] 1 readbytes
[notice] mod_dumpio:  dumpio_in (data-HEAP): 1 bytes
[notice] mod_dumpio:  dumpio_in (data-HEAP): S
[notice] mod_dumpio: dumpio_in [getline-blocking] 0 readbytes
[notice] mod_dumpio:  dumpio_in (data-HEAP): 1 bytes
[notice] mod_dumpio:  dumpio_in (data-HEAP): S
[notice] mod_dumpio:  dumpio_in (data-HEAP): 28 bytes
[notice] mod_dumpio:  dumpio_in (data-HEAP): erver: AllegroServe/1.2.50\r\n
[notice] mod_dumpio: dumpio_in [speculative-blocking] 1 readbytes
[notice] mod_dumpio:  dumpio_in (data-HEAP): 1 bytes
[notice] mod_dumpio:  dumpio_in (data-HEAP): C
[notice] mod_dumpio: dumpio_in [getline-blocking] 0 readbytes
[notice] mod_dumpio:  dumpio_in (data-HEAP): 1 bytes
[notice] mod_dumpio:  dumpio_in (data-HEAP): C
[notice] mod_dumpio:  dumpio_in (data-HEAP): 24 bytes
[notice] mod_dumpio:  dumpio_in (data-HEAP): ontent-Type: text/html\r\n
[notice] mod_dumpio: dumpio_in [speculative-blocking] 1 readbytes
[notice] mod_dumpio:  dumpio_in (data-HEAP): 1 bytes
[notice] mod_dumpio:  dumpio_in (data-HEAP): T
[notice] mod_dumpio: dumpio_in [getline-blocking] 0 readbytes
[notice] mod_dumpio:  dumpio_in (data-HEAP): 1 bytes
[notice] mod_dumpio:  dumpio_in (data-HEAP): T
[notice] mod_dumpio:  dumpio_in (data-HEAP): 27 bytes
[notice] mod_dumpio:  dumpio_in (data-HEAP): ransfer-Encoding: chunked\r\n
[notice] mod_dumpio: dumpio_in [speculative-blocking] 1 readbytes
[notice] mod_dumpio:  dumpio_in (data-HEAP): 1 bytes
[notice] mod_dumpio:  dumpio_in (data-HEAP): \r
[notice] mod_dumpio: dumpio_in [getline-blocking] 0 readbytes
[notice] mod_dumpio:  dumpio_in (data-HEAP): 1 bytes
[notice] mod_dumpio:  dumpio_in (data-HEAP): \r
[notice] mod_dumpio:  dumpio_in (data-HEAP): 1 bytes
[notice] mod_dumpio:  dumpio_in (data-HEAP): \n
[notice] mod_dumpio: dumpio_in [readbytes-nonblocking] 8192 readbytes
[notice] mod_dumpio:  dumpio_in (data-HEAP): 49 bytes
[notice] mod_dumpio:  dumpio_in (data-HEAP): 26\r\n<html><body>Hello 
World!</body></html>\r\n0\r\n\r\n
[notice] mod_dumpio: dumpio_out
[notice] mod_dumpio:  dumpio_out (data-HEAP): 196 bytes
[notice] mod_dumpio:  dumpio_out (data-HEAP): HTTP/1.1 200  OK\r\nDate: Thu, 
13 Nov 2008 11:41:58 GMT\r\nServer: AllegroServe/1.2.50\r\nContent-Type: 
text/html\r\nKeep-Alive: timeout=15, max=100\r\nConnection: 
Keep-Alive\r\nTransfer-Encoding: chunked\r\n\r\n
[notice] mod_dumpio: dumpio_out
[notice] mod_dumpio:  dumpio_out (data-TRANSIENT): 4 bytes
[notice] mod_dumpio:  dumpio_out (data-TRANSIENT): 31\r\n
[notice] mod_dumpio:  dumpio_out (data-HEAP): 49 bytes
[notice] mod_dumpio:  dumpio_out (data-HEAP): 26\r\n<html><body>Hello 
World!</body></html>\r\n0\r\n\r\n
[notice] mod_dumpio:  dumpio_out (data-IMMORTAL): 2 bytes
[notice] mod_dumpio:  dumpio_out (data-IMMORTAL): \r\n
[notice] mod_dumpio: dumpio_in [readbytes-nonblocking] 8192 readbytes
[notice] mod_dumpio: dumpio_out
[notice] mod_dumpio:  dumpio_out (metadata-FLUSH): 0 bytes
[notice] mod_dumpio: dumpio_in [readbytes-blocking] 8192 readbytes


Thanks,

Adelfio D'Angio'

-------------------------------------------------------

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Problem with mod_proxy and chunked packets

Posted by Nick Kew <ni...@webthing.com>.
Adelfio D'AngiĆ² wrote:

> In fact if I do a direct http request on the proxied server the output on the 
> browser is correct but when I do the http request through the Apache proxy
> I get this "extra" chunked encoding inside the content of the page.

Is there a URL from where one could see this behaviour?

-- 
Nick Kew

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Problem with mod_proxy and chunked packets

Posted by Adelfio D'AngiĆ² <ad...@freemindconsulting.com>.
>
> You're looking at a chunked response in something that doesn't know
> what to do with the chunked encoding.  Is it a real browser, or are
> you just looking at the dump?
>

Yes, I'm testing with Firefox 3.0.3. Who does wrong with the
chunked encoding seems to be mod_proxy.

> It looked like the Transfer-Encoding: chunked header was set on the
> response and the chunked encoding was correct.

In fact if I do a direct http request on the proxied server the output on the 
browser is correct but when I do the http request through the Apache proxy
I get this "extra" chunked encoding inside the content of the page.


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Problem with mod_proxy and chunked packets

Posted by Eric Covener <co...@gmail.com>.
On Wed, Nov 19, 2008 at 3:54 AM, Adelfio D'Angio'
<ad...@freemindconsulting.com> wrote:
> Hi all,
>
> on Apache 2.2.8 I have a problem with mod_proxy in case of chunked packets.
> This is my Proxy configuration:
> ProxyPass /bld/kernel http://localhost:38315
> ProxyPassReverse /bld/kernel http://localhost:38315
>
> I published an "Hello World!" page on another web server running on port 38315
> but when I use Apache (/bld/kernel/hello2) I get this text:
> 26
> Hello World!
> 0

You're looking at a chunked response in something that doesn't know
what to do with the chunked encoding.  Is it a real browser, or are
you just looking at the dump?

It looked like the Transfer-Encoding: chunked header was set on the
response and the chunked encoding was correct.

-- 
Eric Covener
covener@gmail.com

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org