0

一般的な構成アイテムを含むVirtualHostブロックがあります。1つのディレクティブはProxyPreserveHostです。

RewriteディレクティブのProxyPreserveHostを「手続き的に」オフにしてから、インクルードでオンに戻すことはできますか?例えば:

<VirtualHost *:80>
ServerName www.blah.com
...
...
ProxyPreserveHost off
RewriteRule /somepath http://otherhost/otherpath [P]

Include /path/to/file/turning-on-ProxyPreserveHost

</VirtualHost>

otherhostはCDN上にあり、ホストを保持すると、ホスト名前空間のコンテンツのプロキシを許可しない名前解決の問題が発生します。

ProxyReserveHostは、ServerConfigまたはVirtualHostでのみ許可されます。ProxyPassおよびProxyPassReverseディレクティブ(mod_rewriteのプロキシフラグにカプセル化されている)に対して選択的にオフにできるようには見えません。

4

1 に答える 1

0

以下は、インターネットで見つけたもので、私のジレンマに対処しています。余談ですがProxyPreserveHost、Apache HTTPD プロジェクト内の場所とディレクトリ レベルで構成可能にするオープン機能リクエストがあります。

<IfModule mod_headers.c>
  <プロキシ "http://${build.replace.host}/">
    RequestHeader セット ホスト ${build.replace.external.host}
  </プロキシ>
  RewriteRule ^/proxypath/ http://${build.replace.external.host}/path/to/resource.html [P]
  ProxyPassReverse /proxypath/ http://${build.replace.external.host}/path/to/resource.html
</IfModule>
于 2010-05-12T18:15:12.763 に答える