HomeServerlessFunctionsHow to
Add a custom domain name to a function
Jump toUpdate content

How to add a custom domain to a function

Reviewed on 12 July 2023 • Published on 21 February 2022

Each function comes with an automatically generated domain on which it is available. However, it is possible to assign your own domain name to make it easier to use your functions.

Security & Identity (IAM):

You may need certain IAM permissions to carry out some actions described on this page. This means:

  • you are the Owner of the Scaleway Organization in which the actions will be carried out, or
  • you are an IAM user of the Organization, with a policy granting you the necessary permission sets
Requirements:
  1. Add a CNAME record pointing to your function’s default URL from the domains dashboard.
  2. Click the Endpoints tab on your Function’s Overview page.
  3. Click + Add endpoint.
  4. Enter your custom domain URL and validate the form.
  5. Connect to your function using your custom domain once the CNAME and TLS fields are validated by the Console.
Important:

Custom Domains do not support websockets. If you need to use websockets, you must configure them with the original container URL.

Cloudflare DNS

If you are using Cloudflare DNS to configure your custom domain, you must set the CNAME record’s proxy status to DNS Only while adding it to your function. We perform a number of validation checks on our side when configuring your domain, and if the CNAME record is proxied during these checks, the checks will fail.

Once you have configured your domain and your function is responding correctly, you can set the CNAME record back to Proxied if you wish.

The Cloudflare documentation on Proxy Status describes how to change the Proxy Status of a CNAME record via the Cloudflare web UI.

See Also