Using your own domain

When you are going to launch your new cat venture, you need a separate domain. The domain needs to be setup with so it points to APPNAME.app.iterate.no or 35.195.169.101. You can either buy the domain yourself or ask in the #ops slack channel.

After the DNS is updated, you must add it to iterapp.toml:

domains=["cats.cool"]

The first domain in the list will be the main domain.

After you have deployed to test and prod, the prod version will be available on cats.are.cool. SSL is automatically setup thanks to Let's Encrypt.

Your configured domains are also available to your app as environment variables:

  • HOPS_DOMAIN: The main domain the app listens to
  • HOPS_DOMAINS: Comma separated list of all the domains the app listens to

WWW redirect

Iterapp supports redirects both from and to www:

  1. Make sure both DNS alternatives are setup, so both www.cats.cool and cats.cool will point to 35.195.169.101
  2. Add the domain you will use in domains to iterapp.toml.
    1. Do not add the domain you are redirecting from
  3. Add the from_to_www_redirect=true to iterapp.toml

So if you like www

from_to_www_redirect=true
domains=["www.cats.cool"]

And if you do not want www

from_to_www_redirect=true
domains=["cats.cool"]

DNS and from_to_www_redirect

If you use from_to_www_redirect, Iterapp will ask for an ssl certificate on all redirects.

The certificate lookup will fail if not all domains are setup correctly.

That means that for each domain you add, you must setup DNS for www.DOMAIN. So if your cats domain also has my.cats.cool, then iterapp.toml must have these properties:

from_to_www_redirect=true
domains=["cats.cool", "my.cats.cool"]

And you must setup DNS for

  • cats.cool
  • www.cats.cool
  • my.cats.cool
  • www.my.cats.cool

Or do it by adding DNS with wildcard: *.cats.cool

Use DNS for verification

If you are moving a domain to another location and do not want any downtime, you can use a dns01 verification.

Wait to change the A-record for your domain, but set up the following if your domain is cats.cool

_acme-challenge.cats.cool CNAME acme-auth.iterate.no
_acme-challenge.www.cats.cool CNAME acme-auth.iterate.no

Note

Remove www if you do not want the www redirect.

Update iterapp.toml and deploy to prod.

from_to_www_redirect=true
domains=["cats.cool"]
dns01_for_acme = true

Once the certificate is in place, you can update the A records as mentioned above. Check with #ops if you do not know how to verify it yourself.