Skip to main content
Prerequisite: Your primary domain (company.com) is hosted on and you are on the Mintlify Pro plan or above.

Create Cloudflare Worker

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

Add custom domain

Once the worker is created, click Configure 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.
Cloudflare worker custom domain
If you have trouble setting up a custom subdirectory, contact our support team and we’ll walk you through upgrading your hosting with us.

Edit Worker Script

Click on Edit Code and add the following script into the worker’s code.
Cloudflare edit code
Edit DOCS_URL by replacing [SUBDOMAIN] with your unique subdomain and CUSTOM_URL with your website’s base URL.
Click on Deploy and wait for the changes to propagate (it can take up to a few hours).