Error 522 for Custom Hostname - Worker Not Triggering

For Workers & Pages, what is the name of the domain?

uimagine org

What is the error number?

522

What is the error message?

The initial connection between Cloudflare’s network and the origin web server timed out. As a result, the web page can not be displayed. Contact your hosting provider letting them know your web server is not completing requests. An Error 522 means that the request was able to connect to your web server, but that the request didn’t finish. The most likely cause is that something on your server is hogging resources. Additional troubleshooting information here.

What is the issue or error you’re encountering

I’m facing an issue with a custom hostname (uimagine.org) on my SaaS zone (uimagine,site). While joshuatay.xyz works fine, uimagine.org returns an Error 522 (Connection Timed Out), and my Worker isn’t logging requests for it. I need help diagnosing this.

What steps have you taken to resolve the issue?

I’m encountering an issue with a custom hostname on my SaaS zone. One custom hostname works fine, but another returns an Error 522 (Connection Timed Out), and my Worker isn’t logging requests for it. I need help diagnosing this.

Setup
SaaS Zone: My primary zone for the SaaS platform.
Fallback Origin: A subdomain of my SaaS zone (Active in Custom Hostnames).
Custom Hostnames:
First custom hostname: Active, works perfectly.
Second custom hostname: Active, but fails with Error 522.
Worker Route: Set to catch all subdomains of my SaaS zone (e.g., .saas-zone/).
R2 Bucket: Files stored as custom-domain//index.html.
DNS
Registrar:
First custom hostname: Namecheap, using Cloudflare nameservers.
Second custom hostname: Route 53, also using Cloudflare nameservers.
DNS for Second Custom Hostname:
Proxied CNAME at the apex pointing to the fallback origin.
dig for A records returns Cloudflare IPs, confirming proxying.
Worker Script
My Worker serves R2 files based on the Host header.

Visiting the second custom hostname results in Error 522, with no Worker logs. The first custom hostname works fine, serving R2 content as expected. I’ve confirmed:

The second custom hostname is Active in Custom Hostnames.
R2 has the expected file (custom-domain//index.html).
The fallback origin works when accessed directly.
Cache purged, DNS verified (A records show Cloudflare IPs).
Request
Why aren’t requests for the second custom hostname reaching my Worker? Is there a routing issue? The only difference is the registrar (Route 53 vs. Namecheap), but both use Cloudflare DNS.

What are the steps to reproduce the issue?

Visiting the second custom hostname results in Error 522, with no Worker logs. The first custom hostname works fine, serving R2 content as expected.

Screenshot of the error

This topic was automatically closed after 15 days. New replies are no longer allowed.