Create Cloudflare Worker
Navigate to theWorkers & Pages > Create application > Create worker. You
should be presented with the following screen where you can create a new
Cloudlfare worker.

Keep in mind: If your DNS provider is Cloudflare you should not use proxying for the CNAME record
Add custom domain
Once the worker is created, clickConfigure worker. Navigate to the worker
Settings > Triggers. Click on Add Custom Domain to add your desired domain
into the list - we recommend you add both the version with and without www.
prepended to the domain.

Edit Worker Script
Click onEdit Code and add the following script into the worker’s code.

Edit
DOCS_URL by replacing [SUBDOMAIN] with your unique subdomain and
CUSTOM_URL with your website’s base URL.Deploy and wait for the changes to propagate (it can take up to a few
hours).