Why are http headers not set when I use proxypass on apache2.2

I have an apache2.2 server with mod_proxy and mod_headers installed. On a request running with a ProxyPass directive, none of the Header set directives work, ie the header's aren't set in the response.

However if I remove the ProxyPass directive the headers are set. Is there some configuration that disables setting headers when using mod_proxy?


Solution 1:

Despite the Apache mod_headers doc saying that it does not matter where the Header line goes, it apparently does. The only way I could get the header added was to put it in the same location scope as the proxy pass.

I initially had the proxy pass defined in the VirtualHost tag directly, but had to move it into the LocationMatch sub tag.

<LocationMatch "/myapp">
    ProxyPass http://1.1.1.1:8080/myapp disablereuse=On
    ProxyPassReverse http://1.1.1.1:8080/myapp
    Header add X-UA-Compatible "IE=7"
</LocationMatch>