LoginSignup
1
1

More than 5 years have passed since last update.

WebApp on Linux でビルトインのコンテナ使った場合に apache 側で http to https リダイレクトする

Last updated at Posted at 2017-02-15

結論

.htaccess に以下の内容を書けばOK

RewriteEngine On
RewriteCond %{HTTP:X-ARR-SSL} ^$
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

補足

  • WebApp on Linux では IIS ARR が Front で、apache がアプリケーションコンテナ側で動いている
  • IIS ARR を経由すると、HTTP Header にいくつかの情報が付加される
  • MS の ARR の概要 を読むと通常の IIS では SSL オフロードがデフォルト有効で、WebApp を検証した限りでも IIS と apache 間は HTTP でやりとりされている模様

最後に

コンテナの中身次第になるので本来は Web.config で書くのがよい気がしますが、ググってたどり着くやり方では動かず、よくわかりませんでした。
ご存じの方いらっしゃいましたらぜひ教えてください。

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1