You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: advanced/subpath/cloudflare.mdx
+26-29Lines changed: 26 additions & 29 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,49 +3,46 @@ title: "Cloudflare"
3
3
description: "Host documentation at a /docs subpath using Cloudflare Workers"
4
4
---
5
5
6
-
## Create CloudflareWorker
6
+
To host your documentation at a `/docs` subpath using Cloudflare, you will need to create and configure a Cloudflare Worker.
7
7
8
-
Navigate to the `Workers & Pages > Create application > Create worker`. You
9
-
should be presented with the following screen where you can create a new
10
-
Cloudflare worker.
8
+
<Note>
9
+
If your domain already points to another service, you will need to remove the existing DNS record. This process can cause brief downtime.
10
+
</Note>
11
11
12
-
<Frame>
13
-
<imgalt="Create a Cloudflare worker"src="/images/cloudflare/worker.png" />
14
-
</Frame>
12
+
## Prerequisites
13
+
14
+
Before you begin, make sure you have:
15
+
16
+
- A Cloudflare account
17
+
- A domain name (can be managed on or off Cloudflare)
18
+
19
+
## Set up a Cloudflare Worker
20
+
21
+
Create a Cloudflare Worker by following the [Cloudflare Workers getting started guide](https://developers.cloudflare.com/workers/get-started/dashboard/), if you have not already.
15
22
16
23
<Warning>
17
-
Keep in mind: If your DNS provider is Cloudflare you should not use proxying for the CNAME record
24
+
If your DNS provider is Cloudflare, do not use proxying for the CNAME record.
18
25
</Warning>
19
26
20
27
### Add custom domain
21
28
22
-
Once the worker is created, click `Configure worker`. Navigate to the worker
23
-
`Settings > Triggers`. Click on `Add Custom Domain` to add your desired domain
24
-
into the list - we recommend you add both the version with and without `www.`
25
-
prepended to the domain.
29
+
1. In your [Cloudflare dashboard](https://dash.cloudflare.com/), navigate to your Worker.
30
+
2. Go to **Settings > Domains & Routes > Add > Custom Domain**.
31
+
3. Add your domain.
26
32
27
-
<Frame>
28
-
<img
29
-
alt="Cloudflare worker custom domain"
30
-
src="/images/cloudflare/custom-domain.png"
31
-
/>
32
-
</Frame>
33
+
<Tip>
34
+
We recommend you add your domain both with and without `www.` prepended.
35
+
</Tip>
33
36
34
-
If you have trouble setting up a custom subdirectory,
35
-
[contact our support team](https://mintlify.com/docs/support) and we'll walk you through
36
-
upgrading your hosting with us.
37
+
See [Add a custom domain](https://developers.cloudflare.com/workers/configuration/routing/custom-domains/#add-a-custom-domain) in the Cloudflare documentation for more information.
37
38
38
-
### Edit Worker Script
39
+
### Configure routing
39
40
40
-
Click on `Edit Code` and add the following script into the worker's code.
41
+
In your Cloudflare dashboard, select **Edit Code** and add the following script into your Worker's code. See the [Cloudflare documentation](https://developers.cloudflare.com/workers-ai/get-started/dashboard/#development) for more information on editing a Worker.
0 commit comments