tip minersTip Miners

Add a custom domain to your Cloudflare worker

Add a custom domain to your Cloudflare workerWritten by Miguel

The solution to using a custom domain in a Cloudflare worker is make use of custom_domain option from the route config for wrangler

Steps

  1. Change your wrangler.toml , add or modify your route entry to 
    route = { pattern = "yourdomain.com" , custom_domain = true }
  2. Publish your worker with wrangler publish

👍🏼 Dos

  • Use wrangler config, it always needs to be your source of true

👎🏼 Dont’s

  • Avoid using the dashboard option , you might override what you set up with your wrangler config

More articles of Cloudflare Workers

Have your professional domain email address for free with cloudflare and gmail

Setting Up a Free Business Email with Gmail and Cloudflare: A Simple Guide