I have two proxypass rules on my web host, one that points to a local varnish instance for caching purposes, which I want ProxyPreserveHost enabled for, and another that points to a third party hosted site, which I want ProxyPreserveHost disabled for. Is there anyway I can do this on a per rule/pass basis?
Under Apache 2.2, no - the
In Apache 2.4, yes - the directory context has been added for the directive, so you can now do something such as:
You can with help of RequestHeader
I'm unable to upvote Sorin's response...
In our local situation running Apache 2.2, and the primary app requires proxypreservehost (CQ/AEM author) to login, but a partner we proxy to requires their host in the host header.
We don't need to do this with regex though, a regular
From documentation (http://httpd.apache.org/docs/2.2/mod/core.html#location):
This solution works for us:
This sets the host header for this request to the partner's hostname.
With that in place, we can continue to login to CQ/AEM author AND proxy to the partner service using their expected host header.