私はありません.htaccessファイルを作成しようとしている以下:はどのように.htaccessファイルを通じてEC2のヘルスチェックを可能にする
1は、EC2のヘルスチェックURLがhttps にリダイレクトせずに打つことができるようにします2 https以外のすべてのトラフィックをhttpsにリダイレクト 3 httpsを使用して/ to/auth/app/public/appにリダイレクトする
項目2と3はうまく動作しますが、ヘルスチェックは失敗し、サーバは応答しなくなります。ここに私の.htaccessファイルの内容は次のとおりです。
RewriteEngine On
#one attempt that didn't work
#RewriteCond %{HTTP_HOST} !^my\.domain\.com$ [NC]
#RewriteCond %{REQUEST_URI} !^/healthcheck.html$
#RewriteRule^http://my.domain.com/$1 [R=301,L]
#another attempt that didn't work
#RewriteCond %{HTTP_HOST} !$ [NC]
#RewriteCond %{REQUEST_URI} !^/healthcheck.html$
#RewriteRule ^(.*)$ /$1 [L,QSA]
#this works
RewriteRule ^$ https://my.domain.com/auth/app/public/app/ [L]
#this works
RewriteCond %{HTTP:X-Forwarded-Proto} !https
RewriteRule^https://my.domain.com%{REQUEST_URI} [L]
最初の二つはコメントアウトされた試みは、私がhttps://serverfault.com/questions/470015/how-should-i-configure-my-elb-health-check-when-using-namevirtualhosts-and-redir とhttps://serverfault.com/questions/470015/how-should-i-configure-my-elb-health-check-when-using-namevirtualhosts-and-redir/597541#597541
で発見例からあなたは私が得ることができるどのように任意の提案を持っているなら、私に知らせてくださいますこの作業。
\ .htmlを$:ここに私の.htaccessファイルの作業バージョンです何も書き換えない( ' - ')、これを最後のルールにする。追加のRewriteCondsは必要ありません。 – CBroe