Heroku に Route53 でルートドメインを割り当てる

Heroku に Route53 で直接ルートドメイン(Apex ドメイン)を割り当てることはできないらしい。

その代わり、以下のドキュメントを参考に S3 のリダイレクト機能と Route53 のエイリアスの機能を組み合わせる。

https://devcenter.heroku.com/articles/route-53#naked-root-domain

S3 の設定

  1. バケットを作成する
  2. Properties タブを開く
  3. Static Website Hosting をクリックし、以下のように設定
    • Redirect all requests to another host name: ON
    • Redirect all requests to: Heroku アプリの URL (******.herokuapp.com とか) を指定

f:id:suer:20140501101929p:plain

Route53 の設定

ルートドメインを以下のように設定

  • Type: A
  • Alias: YES
  • Alias Target: テキストボックスにフォーカスすると先ほど作成した S3 のバケットが出てくるのでそれを選択する