How do I connect a custom domain to my service?
You can serve any Forte service or website on your own domain, or on every subdomain of it with a wildcard, with TLS issued and renewed for you.
Steps
- Open your service or website in the console and go to its Domains tab.
- Add the domain — for example
app.yourcompany.com, or the apexyourcompany.com. - If the domain's DNS is hosted with Forte, Forte adds the required records automatically. Otherwise, add the exact records shown in the console to your DNS provider.
- Forte checks the records immediately and every 10 minutes for up to 48 hours. Once they resolve, Forte validates the domain and issues a TLS certificate automatically.
Serving every subdomain with a wildcard
If your app gives each customer or workspace its own subdomain, such as acme.yourcompany.com, add a wildcard like *.yourcompany.com instead of connecting each subdomain one by one. A wildcard serves every subdomain one level down, so acme.yourcompany.com and tenant-42.yourcompany.com both reach the same service or website. It doesn't cover yourcompany.com itself or deeper names like a.b.yourcompany.com, and Forte doesn't add www for it. Connect any of those separately if you need them.
A subdomain you connect on its own takes priority over the wildcard. If *.yourcompany.com points at your app and api.yourcompany.com is connected to a different service, requests for api.yourcompany.com go to that service and everything else goes to the wildcard's.
Your code receives the subdomain that was requested, so it can tell tenants apart. A service reads it from the Host header, and a website rendered on the server reads it from x-forwarded-host. A static website serves the same files on every subdomain.
A wildcard needs two DNS records, and you add the second one a few seconds after the first:
- Traffic record. A CNAME from
*.yourcompany.comto the Forte address shown in the console, the same kind of record a single subdomain uses. - Certificate validation record. A CNAME with a random-looking name such as
_3f9a….yourcompany.com, pointing at a value that ends inacm-validations.aws. Forte's certificate provider, Amazon Certificate Manager, generates this record, so it appears in the console shortly after you add the domain.
Keep the certificate validation record in place permanently. The certificate covering every subdomain renews each year by checking this record again. If you delete it, the renewal fails and the certificate expires. The record doesn't change when the certificate renews, or if you remove the wildcard and add it again later.
Many DNS providers add your domain to the end of whatever you type in the name field. If yours does, enter only the part before .yourcompany.com, for example * and _3f9a…, or the record ends up as _3f9a….yourcompany.com.yourcompany.com. On Cloudflare, set the traffic record to DNS only, as for any Forte domain. If your domain has CAA records, they must allow amazon.com to issue certificates.
When you add a wildcard with the CLI, put it in quotes, for example forte websites domains add <project-id> <website-id> '*.yourcompany.com'. Without quotes, your shell tries to expand the * and stops with an error before the command runs.
If Forte hosts the domain's DNS, it writes both records for you, and there is nothing to copy.
Tips
- A subdomain (like
app.orwww.) uses a single CNAME record. For a Cloudflare apex domain, create a CNAME at@; Cloudflare flattens it automatically. Other providers may call the equivalent an ALIAS or ANAME record. - DNS changes can take a little while to propagate. Forte keeps checking automatically, and Check now is available as an optional accelerator.
- HTTPS is automatic — you never upload or renew certificates yourself.
If a domain is stuck validating, double-check that the records match exactly, then contact support.