これがシナリオです。
サーバーはWin2k8で、IIS7.5を実行しています。ARRとURLRewrite2をインストールしています。
最新のUbuntuサーバーを実行している仮想ボックスがあります。Apache、mySQL、PHPがすべてインストールされています。
IISをリバースプロキシとして構成し、URLReWriteを次のように設定しました。
<rewrite>
<rules>
<rule name="ReverseProxyInboundRule1" stopProcessing="false">
<match url="(.*)" />
<action type="Rewrite" url="http://192.168.1.17/{R:1}" />
</rule>
</rules>
</rewrite>
http://dev.o7t.inがVM上のapacheで構成されたサイトに正しくルーティングされることを確認しましたが、 http: //wp.o7t.inはまったく同じ場所にリダイレクトされます。これがapacheの両方のサイトからの設定です:
開発者:
# NameVirtualHost *:80
<VirtualHost *>
ServerName devo7tin
ServerAlias dev.o7t.in
ServerAdmin support@o7t.in
DocumentRoot /var/www/dev/
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/dev/>
Options -Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>
</VirtualHost>
wp:
# NameVirtualHost *:80
<VirtualHost *>
ServerName wpo7tin
ServerAlias wp.o7t.in
ServerAdmin support@o7t.in
DocumentRoot /var/www/wordpress/
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/wordpress/>
Options -Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>
</VirtualHost>
NameVirtualHostはports.confですでに設定されています
私が気付いているのはホストヘッダーであり、常に仮想マシンのIPアドレス(この場合は192.168.1.17)に戻り、要求されたホストを完全に無視します。
では、どうすればこれを回避して、VMに正しいHTTP_HOSTヘッダーを渡すことができますか?