httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas Eckert <Thomas.Eck...@Sophos.com>
Subject Re: [users@httpd] mod_proxy_html, HTML rewrite and content compression
Date Fri, 16 Nov 2012 10:31:38 GMT
On 11/14/2012 06:12 PM, Nick Kew wrote:
> On 14 Nov 2012, at 15:53, Thomas Eckert wrote:
>
>> Is there a way to work around this ? I do want the call to mod_xml2enc to happen
but I also want the reverse proxy to support content compression.
> That's a lot of correct analysis.
>
> The output chain you want is INFLATE;xml2enc;proxy-html;DEFLATE .
> What problems do you encounter (apart from processing overhead)
> when you set all that?
>
> I guess ideally ProxyHTMLEnable should detect compressed content
> and insert INFLATE where necessary.  Maybe even have an option to
> set DEFLATE.  But as of now it doesn't: I got the impression most
> users prefer to disable compression, and avoid the substantial
> processing overhead of zipping in a proxy.
>
Thanks for the hint but unfortunately "manually" adding xml2enc to the 
filtering chain does not help. The output is still broken. One thing I 
noticed was the "DEFLATE" filter is not necessary, since apache will do 
the compression anyway (even though I removed "AddOutputFilter text/html 
DEFLATE" from my global config). That's why it's not present below.

Here are some debug log extracts which confuse me. Note, I patched 
mod_proxy_html.c with a one-liner to get me "Running proxy_html_filter" 
into the log, otherwise mod_proxy_html only gives feedback in error 
situations and I wouldn't be able to defer from the log when 
mod_proxy_html is running.


     "SetOutputFilter INFLATE;proxy-html" gets the page displayed correctly

[pid 14245:tid 2714090352] proxy_util.c(1998): AH00943: http: has 
released connection for (vhost01.backend03.local)
[pid 14245:tid 2714090352] mod_deflate.c(1283): [client 
10.10.10.10:40375] AH01398: Zlib: Inflated 348 to 674 : URL /
[pid 14245:tid 2714090352] [client 10.128.128.60:40375] Running 
proxy_html_filter
[pid 14245:tid 2714090352] mod_deflate.c(763): [client 
10.10.10.60:40375] AH01384: Zlib: Compressed 655 to 342 : URL /
< customized log message from LogFormat+CustomLog appears here >


     "SetOutputFilter INFLATE;xml2enc;proxy-html" results in "curl: (52) 
Empty reply from server"

[pid 15039:tid 3007834992] proxy_util.c(1998): AH00943: http: has 
released connection for (vhost01.backend03.local)
[pid 15039:tid 3007834992] mod_deflate.c(1283): [client 
10.10.10.10:40388] AH01398: Zlib: Inflated 348 to 674 : URL /
[pid 15039:tid 3007834992] mod_xml2enc.c(183): [client 
10.10.10.10:40388] AH01430: Content-Type is text/html
[pid 15039:tid 3007834992] mod_xml2enc.c(259): [client 
10.10.10.10:40388] AH01434: Charset ISO-8859-1 not supported by libxml2; 
trying apr_xlate
[pid 15039:tid 3007834992] mod_xml2enc.c(463): [client 
10.10.10.10:40388] AH01439: xml2enc: consuming 674 bytes from bucket
[pid 15039:tid 3007834992] mod_xml2enc.c(490): [client 
10.10.10.10:40388] AH01441: xml2enc: converted 674/674 bytes
[pid 15039:tid 3007834992] [client 10.10.10.10:40388] Running 
proxy_html_filter
[pid 15039:tid 3007834992] mod_deflate.c(763): [client 
10.10.10.10:40388] AH01384: Zlib: Compressed 655 to 342 : URL /
[pid 15039:tid 3007834992] mod_xml2enc.c(463): [client 
10.10.10.10:40388] AH01439: xml2enc: consuming 10 bytes from bucket
[pid 15039:tid 3007834992] mod_xml2enc.c(490): (22)Invalid argument: 
[client 10.10.10.10:40388] AH01441: xml2enc: converted 1/1 bytes
[pid 15039:tid 3007834992] [client 10.10.10.10:40388] AH01444: Skipping 
invalid byte(s) in input stream!
[pid 15039:tid 3007834992] mod_xml2enc.c(490): [client 
10.10.10.10:40388] AH01441: xml2enc: converted 9/8 bytes
[pid 15039:tid 3007834992] mod_xml2enc.c(463): [client 
10.10.10.10:40388] AH01439: xml2enc: consuming 342 bytes from bucket
< customized log message from LogFormat+CustomLog appears here >
[pid 15039:tid 3007834992] mod_xml2enc.c(490): (22)Invalid argument: 
[client 10.10.10.10:40388] AH01441: xml2enc: converted 2/2 bytes
[pid 15039:tid 3007834992] [client 10.10.10.10:40388] AH01444: Skipping 
invalid byte(s) in input stream!
[pid 15039:tid 3007834992] mod_xml2enc.c(490): (22)Invalid argument: 
[client 10.10.10.10:40388] AH01441: xml2enc: converted 2/1 bytes
[pid 15039:tid 3007834992] [client 10.10.10.10:40388] AH01444: Skipping 
invalid byte(s) in input stream!
[pid 15039:tid 3007834992] mod_xml2enc.c(490): (22)Invalid argument: 
[client 10.10.10.10:40388] AH01441: xml2enc: converted 4/3 bytes
[pid 15039:tid 3007834992] [client 10.10.10.10:40388] AH01444: Skipping 
invalid byte(s) in input stream!
[pid 15039:tid 3007834992] mod_xml2enc.c(490): (22)Invalid argument: 
[client 10.10.10.10:40388] AH01441: xml2enc: converted 1/0 bytes
[pid 15039:tid 3007834992] [client 10.10.10.100:40388] AH01444: Skipping 
invalid byte(s) in input stream!
[pid 15039:tid 3007834992] mod_xml2enc.c(481): [client 
10.10.10.10:40388] AH01440: xml2enc: reinserting 332 unconsumed bytes 
from bucket
[pid 15039:tid 3007834992] [client 10.10.10.10:40388] AH01385: Zlib 
error -2 flushing zlib output buffer ((null))


     "ProxyHTMLEnable On" results in  "curl: (61) Error while processing 
content unencoding: invalid code lengths set"

[pid 16165:tid 3007834992] proxy_util.c(1998): AH00943: http: has 
released connection for (vhost01.backend03.local)
[pid 16165:tid 3007834992] mod_xml2enc.c(183): [client 
10.10.10.10:40406] AH01430: Content-Type is text/html
[pid 16165:tid 3007834992] mod_xml2enc.c(259): [client 
10.10.10.10:40406] AH01434: Charset ISO-8859-1 not supported by libxml2; 
trying apr_xlate
[pid 16165:tid 3007834992] mod_xml2enc.c(463): [client 
10.10.10.10:40406] AH01439: xml2enc: consuming 366 bytes from bucket
[pid 16165:tid 3007834992] mod_xml2enc.c(490): [client 
10.10.10.10:40406] AH01441: xml2enc: converted 255/366 bytes
[pid 16165:tid 3007834992] mod_xml2enc.c(490): [client 
10.10.10.10:40406] AH01441: xml2enc: converted 111/159 bytes
[pid 16165:tid 3007834992] [client 10.128.128.60:40406] Running 
proxy_html_filter
[pid 16165:tid 3007834992] mod_xml2enc.c(463): [client 
10.10.10.10:40406] AH01439: xml2enc: consuming 537 bytes from bucket
[pid 16165:tid 3007834992] mod_xml2enc.c(490): [client 
10.10.10.10:40406] AH01441: xml2enc: converted 1306/1306 bytes
[pid 16165:tid 3007834992] mod_proxy_balancer.c(656): [client 
10.10.10.10:40406] AH01176: proxy_balancer_post_request for 
(balancer://cd107d9706d71153bafd4ab15f1c6b5d)
< customized log message from LogFormat+CustomLog appears here >

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message