Nick Kew schrieb:
On Sun, 24 Feb 2008 00:38:08 +0100
My Apache 2.2.3 does reverse proxy to an internal backend (application)server which does Content-Encoding:gzip (=compression)on most of the content he delivers, by default. The Proxy* directives are inside a virtual host.Can you not configure the backend not to send you compressed?
No, can't do...
But I'd like the proxy to do all the compression work,a) because mod_security cannot handle encoded content(in the response from backend),You can of course decompress on the proxy if necessary, for the benefit of content filters (such as mod_security).
Yes I thought of that, but it would be somewhat more redundant, the backend would have to compress -> proxy decompresses and inspects content -> compresses again ...
b) it would be redundant to compress the already compressed content. So to talk to the backend uncompressed, I strip the Accept-Encoding with "Request-Header unset Accept-Encoding" from the client request. Now the backend sends its responses without compression. But they go to the client uncompressed too, of course.Yep.What would I have to do to let the proxy compress the response to the client (again)? Simply setting the SetOutputFilter DEFLATE is notenough. Also I would have to deal with clients not supporting compression on the proxy myself, instead of letting the backend do the work.You can use force-gzip to override the absence of Accept-Encoding. Use mod_rewrite to set it conditionally, before stripping the real Accept-Encoding header.
Couldn't I set a EnvVariable if the client wishes compression, then strip the Accept-Encoding header, (request goes to backend without Accept-Encoding), and then apply a DEFLATE filter on the response to the client conditionally, depending on the before set variable? Or like compress everything coming from the backend, depending on the initial (clients) Accept-Encoding header? Or maybe I am overestimating the "httpd.conf" potential and there is no way to distinguish the response coming from the backend and the response going to the client, same applying to the request?
Thanks a lot, matthias --------------------------------------------------------------------- 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@xxxxxxxxxxxxxxxx " from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx