Cloudflare Pages custom domain shows Error 522? Add it in Pages first
Ship ItChecked against the official source
Source checked 10 Oct 2026 · Published 23 Oct 2026 · Last reviewed 23 Oct 2026 · By Ctrl+Z Therapy (how we test)
The short answer
Cloudflare's docs say Error 522 occurs when Cloudflare times out contacting the origin web server. On Pages, Cloudflare names one cause directly: manually adding a custom CNAME record pointing to your Pages site, without first associating the domain in the Cloudflare Pages dashboard, results in your domain failing to resolve and a 522 error. The fix is to go through the Add a custom domain process in Pages.
What to do
- In Cloudflare, open Workers & Pages and choose your project.
- Open Custom domains and select Set up a domain.
- For a root (apex) domain, the custom domain must be a zone on the same Cloudflare account as your Pages project. A subdomain doesn't have to be a Cloudflare zone and can use a CNAME at another DNS provider, after you add it in Pages.
- Ask your AI tool: "My Cloudflare Pages site shows Error 522 on my custom domain. Walk me through adding the domain under the Pages project's Custom domains and checking the CNAME."
Good to know
- Error 522 has other causes too, like the origin server being down or a firewall. This answer covers the Pages custom domain cause only.
Source
Checked on 10 Oct 2026. Prices, limits and settings change, so check the source before you rely on them.