Proxied CNAME to pages deployment returns host error 522
I am using the environments feature of Pages to setup a dev/staging/prod workflow based on repo branches. The production branch works just fine. However, when I create a cname in my main domain (iom.ai) and point it to the branch specific or deployment specific URLs, I get a "Connection timed out" 522 error (Cloudflare Ray ID: 80c46d9b483d2279).
Doesn't work - CNAME: dev.iom.ai => dev.marketplace-front-end.pages.dev
Doesn't work - CNAME: dev.iom.ai => c0a2ff51.marketplace-front-end.pages.dev
Does work - CNAME: www.iom.ai => marketplace-front-end.pages.dev
cname: https://dev.iom.ai
Branch deployment URL: https://dev.marketplace-front-end.pages.dev
Deployment URL: https://c0a2ff51.marketplace-front-end.pages.dev/
Account: affd14ea816450326dafedc46b68f0fb
Invest on Main Marketplace
IOM.ai is a Real Estate & Alternative Asset marketplace for investing in and trading shares of regulated real estate and other alternative investments (Oil & Gas, Bitcoin Mining Funds, 1031 exchanges, DSTs, Staking Funds, Mineral Rights, and more) issued by vetted sponsors with verifiable track records.
Invest on Main Marketplace
IOM.ai is a Real Estate & Alternative Asset marketplace for investing in and trading shares of regulated real estate and other alternative investments (Oil & Gas, Bitcoin Mining Funds, 1031 exchanges, DSTs, Staking Funds, Mineral Rights, and more) issued by vetted sponsors with verifiable track records.
2 Replies
You have to add them as custom domain in Pages first, and then you can change the CNAME Target to a specific branch: https://developers.cloudflare.com/pages/how-to/custom-branch-aliases/
Add a custom domain to a branch · Cloudflare Pages docs
In this guide, you will learn how to add a custom domain (staging.example.com) that will point to a specific branch (staging) on your Pages project.
Ah, that worked! Thanks!