回答編集履歴
1
追記
answer
CHANGED
@@ -1,3 +1,16 @@
|
|
1
1
|
やりたいことがよくわからないのですが、以下のような感じでしょうか?
|
2
2
|
アクセス元 -> https:ELB:http -> apache:80 -> localhost:8080 OK
|
3
|
-
アクセス元 -> http:ELB:http -> apache:80 -> redirect https
|
3
|
+
アクセス元 -> http:ELB:http -> apache:80 -> redirect https
|
4
|
+
|
5
|
+
以下追記
|
6
|
+
|
7
|
+
以下のようなルールを書けばいいです。
|
8
|
+
ELBからのヘルスチェックはそのまま通るようにしてあげるのがポイントです。
|
9
|
+
|
10
|
+
```
|
11
|
+
RewriteEngine On
|
12
|
+
|
13
|
+
RewriteCond %{HTTP:X-Forwarded-Port} !^443$
|
14
|
+
RewriteCond %{HTTP_USER_AGENT} !^ELB-HealthChecker
|
15
|
+
RewriteRule ^(.*)?$ https://%{HTTP_HOST}$1 [R=301,L]
|
16
|
+
```
|