Introduction to Wagtail | Coders of Colour
Session 5 - Configuring a live URL
Regster a new domain
We can register a new domain in AWS Route53 for our website.
Add your domain to the heroku app
Locate your heroku app > settings and scroll down to domains, click add domain
and add your new domain.
Also, we can configure SSL for our domain in heroku. Note, this requires a hobby plan
. Click configure SSL and choose 'automatic'.
Create a CNAME record in route53
In AWS > Route53, from the left menu go to Hosted Zones. Here is where we can configure the domain for heroku.
Click 'Create Record Set' from the top and create the following record:
name: www type: CNAME value: (your heroku domain dns) E.G triangular-baboon-911v8p58k07zm9dslt6x5f4k.herokudns.com
To retrieve the value for this cname, you can copy it from the heroku domain:
Your CNAME record should look like this:
It's necessary to wait for up to 24h for the domain configuration, particularly for heroku's auto ssl which is submitted to LetsEncrypt.
After the above is configured and validated, you should be able to see your website on https://www.yourdomain.com
Other notes and resources
Verify your DNS settings by running dig www.yourdomainname.com cname +short
. If it returns something like random-name-238ru2.herokudns.com then it is likely you have set it up correctly. If you are using an ALIAS or ANAME record, you can verify that based on the DNS provider. For instance, DNSimple will return a TXT record showing how your domain’s ALIAS is set-up.