[Mod_gzip] mod_gzip + mod_proxy in forward proxy mode
J Kim
mod_gzip@lists.over.net
Tue, 16 Dec 2003 04:45:57 +0900 (JST)
Hello all,
Before I post this message I went through the past archive to see some similar
threads... but there seemed to be no discussion on the problem I have.
I'm using apache 2.0.48, mod_gzip 2.0.40. What I aim to do is to use mod_gzip,
mod_proxy (in forward proxy mode) to compress some of the HTTP objects like
html, doc files. No caching is involved. So the Apache would be like a general
forward proxy server with compression feature for particular objects.
I confirmed that mod_gzip can compress the objects from mod_proxy too. But it
was not 100% successful. It could compress only *small* HTML pages (less than,
approximately 1K) successfully. For the bigger HTML, however, the HTML body was
not correctly encoded, even though the response has "Content-Encoding: gzip"
header.
By "not correctly" I mean that the HTML body does begin with gzip signature (1F
8B ...), but in the body HTML tags are clearly visible! It was not encoded. Of
course browser can't analyze it, failing to display it on the screen. It is
definitely working, but something is wrong.
Since with IE I cannot see what's going on between browser and proxy, I used
wget to see the response. (http://www.xyz.com/end.html is of 422 bytes).
wget http://www.xyz.com/end.html -S --user-agent="Mozilla/4.0 (Compatible;
MSIE 6.0; Windows NT 5.0)" --header="Accept-Encoding: gzip, deflate" -O dnfile
Connecting to 192.168.2.20:8880... connected! <--- I run proxy at port
192.168.2.20:8880
Proxy request sent, awaiting response... 200 OK
2 Date: Mon, 15 Dec 2003 19:20:43 GMT
3 Server: Apache/2.0.47 (Unix) PHP/4.3.4 mod_ssl/2.0.47 OpenSSL/0.9.7a
4 Last-Modified: Mon, 18 Feb 2002 15:49:48 GMT
5 ETag: "20f69-1a6-4e58df00"
6 Accept-Ranges: bytes
7 Content-Length: 305
8 Content-Type: text/html; charset=ISO-8859-1
9 Via: 1.0 199.26.172.28
10 Content-Encoding: gzip
11 Vary: Accept-Encoding
12 Connection: close
13
Everything looks OK. The downloaded file is ungzippable, IE could show the
content too.
But if I requested http://www.xyz.com/index.html which is of 2690 bytes, IE
can't display it, and wget shows something unexpected.
################################
wget http://199.26.172.28/index.html -S
--user-agent="Mozilla/4.0 (Compatible; MSIE 6.0; Windows NT 5.0)"
--header="Accept-Encoding: gzip, deflate" -O dnfile
--14:26:51-- http://199.26.172.28:80/index.html
=> `dnfile'
Connecting to 192.168.2.20:8880... connected!
Proxy request sent, awaiting response... 200 OK
2 Date: Mon, 15 Dec 2003 19:23:48 GMT
3 Server: Apache/2.0.47 (Unix) PHP/4.3.4 mod_ssl/2.0.47 OpenSSL/0.9.7a
4 Last-Modified: Thu, 04 Sep 2003 22:31:32 GMT
5 ETag: "20f6a-a82-8bb6d900"
6 Accept-Ranges: bytes
7 Content-Length: 2690
8 Content-Type: text/html; charset=ISO-8859-1
9 Via: 1.0 199.26.172.28
10 Content-Encoding: gzip
11 Vary: Accept-Encoding
12 Connection: close
13
0K -> . [ 48%]
14:26:51 (1.25 MB/s) - Connection closed at byte 1312. Giving up.
##########################3
And the HTML body is weird:
Have a look -> http://209.178.198.123/dmp.bmp
Following is the relevant portion of httpd.conf:
##############################################
# LoadModule foo_module modules/mod_foo.so
#
LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_ftp_module modules/mod_proxy_ftp.so
LoadModule proxy_http_module modules/mod_proxy_http.so
LoadModule proxy_connect_module modules/mod_proxy_connect.so
LoadModule gzip_module modules/mod_gzip.so
ProxyRequests On
ProxyVia On
<Proxy *>
Order allow,deny
Allow from all
</Proxy>
mod_gzip_on Yes
mod_gzip_can_negotiate Yes
mod_gzip_add_header_count Yes
mod_gzip_minimum_file_size 100
mod_gzip_maximum_file_size 1000000
mod_gzip_keep_workfiles No
mod_gzip_maximum_inmem_size 100000
mod_gzip_dechunk Yes
mod_gzip_min_http 1000
mod_gzip_item_include file \.htm$
mod_gzip_item_include mime text/.*
mod_gzip_item_exclude mime ^image/.*
mod_gzip_temp_dir "/tmp"
mod_gzip_item_include handler proxy-server
mod_gzip_command_version mod_gzip_version
CustomLog logs/gzip.log mod_gzip_info2
##############
Would anyone please tell me what (I've done) is wrong? Any kind of clue would
be greatly appreciated.
Thanks.
Jason J Kim
_____________________________________________________________________
¿¹»Û ÆíÁöÁö¿¡ ¸ÞÀÏÀ» º¸³»¼¼¿ä - ¾ßÈÄ! ¸ÞÀÏ
http://mail.yahoo.co.kr
½ÅÂ÷,Áß°íÂ÷,Á÷°Å·¡ ¸Å¹°ÀÌ ÇÑÀÚ¸®¿¡ - ¾ßÈÄ! ÀÚµ¿Â÷
http://autos.yahoo.co.kr/autos/