Hi Markus,2017-04-26 12:21 GMT+02:00 Markus Gausling <markusgausling@xxxxxxxxxxxxxx> :Hello,
I am using Apache (2.4.10) as an HTTP Proxy with two virtual hosts listening
on different ports:
- Forward Proxy
- Reverse Proxy
Depending on the use case applications either use the Forward Proxy or the
Reverse Proxy.
Now I want to make sure that for both virtual hosts the proxy does handles
content compression (using gzip). Basically there are two use cases that
need to be configured:
- Use Case 1 - Request compressed content and decompress received content
- Use Case 2 - Compress outgoing traffic (HTTP POST)
This is to ensure that applications using any of the two HTTP Proxies do not
need to handle content inflation/deflation (besides other things the
proxies are configured to do).
The applications are basically simple libcurl programms that shall be kept as
simple as possible, which is the reason of this exercise.
Use Case 1 works fine when I add the "Accept-Encoding: gzip" header to each
outgoing request and when I inflate received content. This is achieved by
adding the following to the Virtual Host section of each proxy:
<IfModule mod_deflate.c>
RequestHeader set Accept-Encoding gzip
SetOutputFilter INFLATE
</IfModule>
My problem is that I am not able to configure the Virtual Hosts so that each
HTTP POST request from an application (with uncompressed body) gets deflated
in the HTTP Proxy before being sent to the Web Server.
So my questions are:
- Is this supported by mod_deflate anyway?
- How would I need to configure mod_deflate for this?
- Do I need to handle the Forward and the Reverse Proxy separately or is the
configuration the same?I am probably missing something important but I'd have just used SetOutputFilter DEFLATE for your use cases. My assumption is that the reverse proxy can handle request compression and does not pass any (compressed) requests to the backend as they are, because it shouldn't assume anything about the backend (like being able to handle compression). The HTTP POST outgoing traffic should be deflated with the SetOutputFilter directive as every response returned by the proxy (or maybe a subset of them, depending on the config).Luca