apache-2.2 – ProxyPreserveHost对各个proxypass规则的影响

我的Web主机上有两个proxypass规则,一个指向用于缓存目的的本地varnish实例,我希望启用ProxyPreserveHost,另一个指向第三方托管站点,我希望ProxyPreserveHost禁用.无论如何,我可以按规则/通过基础进行此操作吗?
在Apache 2.2下,没有 – ProxyPreserveHost指令是only valid in the server config or virtual host contexts;您需要将不同的ProxyPass语句放在不同的虚拟主机中.

在Apache 2.4中,是 – directory context has been added for the directive,所以你现在可以做以下事情:

<Location /to-varnish/>
    ProxyPreserveHost On
    ProxyPass http://127.0.0.1:8000/to-varnish/
</Location>
<Location /to-third-party/>
    ProxyPreserveHost Off
    ProxyPass http://third-party-site.com/
</Location>
翻译自:https://serverfault.com/questions/448783/proxypreservehost-on-individual-proxypass-rules

转载注明原文:apache-2.2 – ProxyPreserveHost对各个proxypass规则的影响