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: src/content/docs/pages/configuration/custom-domains.mdx
+4-15
Original file line number
Diff line number
Diff line change
@@ -1,22 +1,15 @@
1
1
---
2
2
pcx_content_type: how-to
3
3
title: Custom domains
4
-
5
4
---
6
5
6
+
import { Render } from"~/components";
7
+
7
8
When deploying your Pages project, you may wish to point custom domains (or subdomains) to your site.
8
9
9
10
## Add a custom domain
10
11
11
-
To add a custom domain:
12
-
13
-
1. Log in to the [Cloudflare dashboard](https://dash.cloudflare.com/login).
14
-
2. Select your account in **Account Home** > **Workers & Pages**.
15
-
3. Select your Pages project > **Custom domains**.
16
-
4. Select **Set up a domain**.
17
-
5. Provide the domain that you would like to serve your Cloudflare Pages site on and select **Continue**.
18
-
19
-

12
+
<Renderfile="custom-domain-steps" />
20
13
21
14
### Add a custom apex domain
22
15
@@ -32,10 +25,8 @@ If you are deploying to a subdomain, it is not necessary for your site to be a C
32
25
33
26
:::note
34
27
35
-
36
28
If the zone is on the Enterprise plan, make sure that you [release the zone hold](/fundamentals/setup/account/account-security/zone-holds/#release-zone-holds) before adding the custom domain. A zone hold would prevent the custom subdomain from activating.
37
29
38
-
39
30
:::
40
31
41
32
#### Add a custom CNAME record
@@ -50,10 +41,8 @@ If your site is already managed as a Cloudflare zone, the CNAME record will be a
50
41
51
42
:::note
52
43
53
-
54
44
To ensure a custom domain is added successfully, you must go through the [Add a custom domain](#add-a-custom-domain) process described above. Manually adding a custom CNAME record pointing to your Cloudflare Pages site - without first associating the domain (or subdomains) in the Cloudflare Pages dashboard - will result in your domain failing to resolve at the CNAME record address, and display a [`522` error](/support/troubleshooting/cloudflare-errors/troubleshooting-cloudflare-5xx-errors/#error-522-connection-timed-out).
55
45
56
-
57
46
:::
58
47
59
48
## Delete a custom domain
@@ -115,4 +104,4 @@ Once a custom domain is set up, if you change the DNS entry to point to somethin
115
104
116
105
## Relevant resources
117
106
118
-
*[Debugging Pages](/pages/configuration/debugging-pages/) - Review common errors when deploying your Pages project.
107
+
-[Debugging Pages](/pages/configuration/debugging-pages/) - Review common errors when deploying your Pages project.
In this tutorial, you will learn how to deploy your Vercel application to Cloudflare Pages.
10
+
import { Render } from"~/components";
11
11
12
-
:::note
12
+
In this tutorial, you will learn how to deploy your Vercel application to Cloudflare Pages.
13
13
14
14
You should already have an existing project deployed on Vercel that you would like to host on Cloudflare Pages. Features such as Vercel's serverless functions are currently not supported in Cloudflare Pages.
15
15
16
-
:::
17
-
18
-
## Finding your build command and build directory
16
+
## Find your build command and build directory
19
17
20
18
To move your application to Cloudflare Pages, you will need to find your build command and build directory. Cloudflare Pages will use this information to build your application and deploy it.
21
19
@@ -31,26 +29,39 @@ Find the **Build & Development settings** panel, which will have the **Build Com
31
29
32
30

33
31
34
-
## Creating a new Pages project
32
+
## Create a new Pages project
35
33
36
34
After you have found your build directory and build command, you can move your project to Cloudflare Pages.
37
35
38
36
The [Get started guide](/pages/get-started/) will instruct you how to add your GitHub project to Cloudflare Pages.
39
37
40
-
## Adding a custom domain
38
+
## Add a custom domain
41
39
42
-
To use a custom domain for your Pages project, [add a custom domain](/pages/configuration/custom-domains/)that is the same custom domain as your currently deployed Vercel application. When Pages finishes the initial deploy of your site, you will need to delete the Vercel application to start sending requests to Cloudflare Pages.
40
+
Next, connect a [custom domain](/pages/configuration/custom-domains/)to your Pages project. This domain should be the same one as your currently deployed Vercel application.
43
41
44
-
:::note
42
+
### Change domain nameservers
45
43
46
-
Cloudflare does not provide IP addresses for your Pages project because we do not require `A` or `AAAA` records to link your domain to your project. Instead, Cloudflare uses `CNAME` records.
44
+
In most cases, you will want to [add your domain to Cloudflare](/dns/zone-setups/full-setup/setup/).
47
45
48
-
For more details, refer to [Custom domains](/pages/configuration/custom-domains/).
46
+
This does involve changing your domain nameservers, but simplifies your Pages setup and allows you to use an apex domain for your project (like `example.com`).
47
+
48
+
If you want to take a different approach, read more about [custom domains](/pages/configuration/custom-domains/).
49
+
50
+
### Set up custom domain
49
51
50
-
:::
52
+
<Renderfile="custom-domain-steps" />
51
53
52
-
## Cleaning up your old application and assigning the domain
54
+
The next steps vary based on if you [added your domain to Cloudflare](#change-domain-nameservers):
53
55
54
-
In your DNS settings for your domain, make sure that you have updated the CNAME record for your domain from Vercel to Cloudflare Pages. With your DNS record updated, requests will go to your Pages application.
56
+
-**Added to Cloudflare**: Cloudflare will set everything up for you automatically and your domain will move to an `Active` status.
57
+
-**Not added to Cloudflare**: You need to [update some DNS records](/pages/configuration/custom-domains/#add-a-custom-subdomain) at your DNS provider to finish your setup.
55
58
56
-
By completing this guide, you have successfully migrated your Vercel project to Cloudflare Pages.
59
+
## Delete your Vercel app
60
+
61
+
Once your custom domain is set up and sending requests to Cloudflare Pages, you can safely delete your Vercel application.
62
+
63
+
## Troubleshooting
64
+
65
+
Cloudflare does not provide IP addresses for your Pages project because we do not require `A` or `AAAA` records to link your domain to your project. Instead, Cloudflare uses `CNAME` records.
66
+
67
+
For more details, refer to [Custom domains](/pages/configuration/custom-domains/).
0 commit comments