CURRENT PROJECTS
loading
CATEGORIES AND POSTS
loading
overset
DEVELOPMENT LOG FOR JIM PALMER
Posted 04/03/2007 in unix


If you have seen this error appear in your Apache logs:
(104)Connection reset by peer: proxy: prefetch request body failed to 10.0.0.2:80 (10.0.0.2) from 10.0.0.2 ()
.. or any error related to what appears to be your mod_proxy declarations failing - as we have - I have discovered two things that will help prevent this issue. This unfortunately came at the expense of our customers somewhat doing all this in the live-environment.

First, after seeing a large amount of these proxy errors and correlating them to the access log and every single request was some form of MSIE 6.0. Red flag right there.

More background - we have an AJAX application served by clustered apache 2.2.4 machines utilizing the new mod_proxy and mod_proxy_balancer modules - which for all intensive purposes works amazingly well. On top of all that we're using the mod_deflate for ALL text-based content including dynamic content and the dynamic content returned by mod_proxy.

MSIE 6.0 - all versions as far as I can tell - have problems with the default configuration. The following changes HAVE to be made if you are going to reliably serve to MSIE 6.0 browsers:
I use the following mod_deflate rules in my live environment which will prevent MSIE of any version from getting compressed Javascript. It also includes not compressing images and pdf files:
SetOutputFilter DEFLATE
SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png|swf)$ \
    no-gzip dont-vary
SetEnvIfNoCase Request_URI \
    \.(?:exe|t?gz|zip|bz2|sit|rar)$ \
    no-gzip dont-vary
SetEnvIfNoCase Request_URI \.(?:js)$ javascript_file=1

# IE 6.0 cannot have compressed javascript
#SetEnvIfNoCase User-Agent "MSIE 6" no-gzip javascript_file=1
# this does not compress anything sent to MSIE 6
# use the above line to only not-compress javascript files
SetEnvIfNoCase User-Agent "MSIE 6" no-gzip dont-vary
# do not compress PDFs
SetEnvIfNoCase Request_URI \.pdf$ no-gzip dont-vary

### no need to downgrade unless proxied server cannot support HTTP/1.1
# downgrade all mod_proxy calls
#SetEnv force-proxy-request-1.0 1
#SetEnv proxy-nokeepalive 1
The above declarations sit in the global httpd.conf to affect all pages served from the cluster.

Apache's mod_deflate does not compress mod_proxy traffic. This means that you're proxied server will need to be doing the compression and in my case it was IIS6 serving the content to the proxy. IIS6 has it's own configuration subtleties that you'll need to configure such as:
comments
loading
new comment
NAME
EMAIL ME ON UPDATES
EMAIL (hidden)
URL
MESSAGE TAGS ALLOWED: <code> <a> <pre class="code [tab4|tabX|inline|bash]"> <br>
PREVIEW COMMENT
TURING TEST
gravatar