Mod_Proxy と Mod_SSL を使用して Apache 2.2.15 を構成し、RHEL 6.3 で CherryPy Web アプリケーションを提供しています。私が苦労しているのは、Web サイトの静的コンテンツ (*.js、*.css、*.jpg) を Apache に提供させることだけです。これが私のVirtualHostエントリです...
<VirtualHost mydomain.com:443>
ServerAdmin support@mydomain.com
ServerName mydomain.com
ProxyPreserveHost On
SSLProxyEngine On
DocumentRoot /var/www/html/mydomain
SSLEngine on
SSLCertificateKeyFile /etc/ssl/myserver.key
SSLCertificateFile /etc/ssl/mydomain_com.crt
SSLCertificateChainFile /etc/ssl/mydomain_com.ca-bundle
# this prevents the follow URL path from being proxied
ProxyPass static/ !
# setup the proxy
<Proxy *>
Order allow,deny
Allow from all
</Proxy>
ProxyPass / http://www.mydomain.com:8080/
ProxyPassReverse / http://www.mydomain.com:8080/
</VirtualHost>
たとえば、私のcssファイルへのパスは次のとおりです...
/var/www/html/mydomain/static/style.css
に移動するときにサイト全体を強制的に https にするため
https://www.mydomain.com/static/style.css
また
http://www.mydomain.com/static/style.css
ブラウザに、ページが見つからない (404) と表示されます。誰かが私が間違っていることを見ることができますか?
編集: Apache はまだ /static をプロキシしているようです... Apache アクセス ログで /static/style.css にアクセスすると、このリダイレクトが見つかりました...
xxx.xxx.xxx.xxx - - [17/Sep/2012:08:46:06 -0400] "GET /static/style.css HTTP/1.1" 301 337 "https://www.mydmain.com/Home/" "Mozilla/5.0 (X11; Linux x86_64; rv:10.0.7) Gecko/20120826 Firefox/10.0.7"
なぜそれが起こっているのか誰か知っていますか?
前もって感謝します!
アンドリュー