By default, all Functions are assigned a unique URL, which is a subdomain of lagon.dev
, pointing to the current production Deployment. The subdomain is always the name of the Function: if your Function is named my-function
, your unique URL will be my-function.lagon.dev
.
All domains (custom or default) are automatically assigned an SSL certificate, provided by Let's Encrypt (opens in a new tab).
Adding a domain
Custom domains aren't yet available as Lagon is still in Alpha. It will be supported for the Beta release.
You can add custom domains or subdomains to your Functions, pointing to the current production Deployment. Head over to the settings tab of your Function, and scroll to the "Domains" section. Here, you can see the default domain as explained above, and your custom domains.
To add a new custom domain or subdomain, write it inside the tags field and press "Enter" or "Space", and then click on "Update":
Pointing your domain to Lagon
Now that you've added a custom domain or subdomain, you must update the DNS settings of your domain to point to Lagon. You can do this by adding a CNAME record, pointing to your Function's default domain.
For a domain
Apex domains (root domains) are not supported. You can instead redirect your apex domain to a www
subdomain.
Let's say that you have the domain my-domain.com
, and you want to point it to your Function named my-function
. You'll first need to redirect your apex domain to a new www
subdomain.
Then, use the following CNAME record to point your www
subdomain to your Function:
www.my-domain.com. 60 IN CNAME my-function.lagon.dev
For a subdomain
Let's say that you have the subdomain hello.my-domain.com
, and you want to point it to your Function named my-function
. Use the following CNAME record to point your subdomain to your Function:
hello.my-domain.com. 60 IN CNAME my-function.lagon.dev
Removing a domain
To remove a custom domain or subdomain, click on the "X" button next to the domain name, and then click on "Update".