Pier1 Sys
Pier1 Sys

Reputation: 1290

Heroku and Route 53

My registrar is godaddy and I run my app on Heroku. I would like to use Route 53 to point to my apps.

Since heroku doesn't recommend A names that point to their proxy, what is the setup I should use? (Or what is the recommended way of setting this up. I do not want to use SimpleDNS, which they talk about in the heroku tutorials).

Thank you,

Upvotes: 10

Views: 7211

Answers (3)

thisismydesign
thisismydesign

Reputation: 25162

Heroku's basic recommendation will redirect to the http version of the site even if you open https. So it's basically useless.

Ideally you want all of the following URLs to resolve to the same place:

For technical reasons, DNS CNAME records (sometimes called ALIAS or ANAME) should be preferred over A records to point to the root (sometimes called apex/bare/naked) domains. While some providers support this, AWS Route 53 does not.

Therefore an ideal AWS setup routes all the above to https://www.example.com.

This can be done at no extra cost but requires some extra pieces of infrastructure (~15 min setup). Unless noted use default config.

1, S3 Bucket to redirect to www. subdomain

  • Create a S3 Static Hosting Website and have it redirect to www.example.com.
  • Use https protocol.

2, SSL certificate in Certificate Manager

3, CloudFront distribution

  • Use 'Redirect HTTP to HTTPS'
  • As origin use the full domain of the S3 bucket. Do not select the bucket from the lsit but use the actual domain. E.g. example.com.s3-website-eu-west-1.amazonaws.com
  • For Alternate Domain Names provide example.com
  • Provide SSL certificates created previously

4, DNS record in Route53

  • A Alias record of example.com pointing to CloudFront
  • CNAME record of www.example.com pointing to Heroku (*.herokudns.com)

Upvotes: 1

Dustin Hoffman
Dustin Hoffman

Reputation: 143

I just finished writing the Naked Domain section of the Heroku docs on Amazon Route 53. This explains how to set up at 302 redirect from example.com to www.example.com using Amazon S3 and Route 53.

Upvotes: 7

birmacher
birmacher

Reputation: 205

First you should transfer your DNS to Amazon Route 53. After that you create a CNAME with your-app.herokuapp.com.

You should also add the domain name pointing to your heroku instance on the app's setting page under the "Domains".

After that it should work.

Upvotes: 1

Related Questions