
我有一個簡單的問題。
在我的環境中有一個這樣配置的apache。
<VirtualHost 1.1.1.1:80>
ServerAdmin [email protected]
DocumentRoot /apps/docroot/
ServerName server.mydomain.tld
<Location /report >
ProxyPass http://report.mydomain.tld/
ProxyPassReverse http://report.mydomain.tld/
</Location>
</VirtualHost>
<VirtualHost 1.1.11:443>
ServerAdmin [email protected]
DocumentRoot /apps/docroot/
ServerName server.mydomain.tld
SSLEngine on
SSLCipherSuite !EXP1024-RC4-SHA:!EXP1024-DES-CBC-SHA:ALL:!ADH:!EXP56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL
SSLCertificateFile /path/to/crt.crt
SSLCertificateKeyFile /path/to/crt.key
SSLCACertificateFile /path/to/CA.crt
</VirtualHost>
問題是,代理設定是否適用於 SSL 虛擬主機? (即,如果我使用 https 存取 /report,該請求是否仍會被代理)..我知道如果我使用 http 它將被代理。
-謝謝維傑
答案1
不,不會的。一台虛擬主機內的指令僅適用於此主機。
如果您想要在多個虛擬主機/位置/目錄上下文中重複套用一組指令,最好的方法是將它們放入單獨的檔案中,並且Include
他們在每個需要他們的地方。