Configuring `Resolve Override` for `Page Rules` always resolves in 522

Hi, I tried to configure Resolve Override for Page Rules to point to a Pages project but it always resolves in 522 error screen. In my domain DNS, I have this configuration
foo.mycompany.com bar.pages.dev
foo.mycompany.com bar.pages.dev
and I configured a rule in Page Rules as
mycompany.com/foo*
Resolve Override: foo.mycompany.com
mycompany.com/foo*
Resolve Override: foo.mycompany.com
I would expect that if I go to https://mycompany.com/foo it should display the page from bar.pages.dev Is there something wrong in my configuration?
4 Replies
Erisa
Erisa•16mo ago
Pages is not compatible with Resolve Override. You will need to proxy via a Worker and in the future can use Cloudflare Snippets (https://blog.cloudflare.com/cloudflare-snippets-alpha/)
Ahn
AhnOP•16mo ago
Thanks for the information. I've read the documentation https://developers.cloudflare.com/rules/origin-rules/features/#dns-record and it seems like it should work. May I know why Pages is excluded?
Available Origin Rules settings · Cloudflare Rules docs
The following sections describe the available settings in Origin Rules.
Erisa
Erisa•16mo ago
It's something to do with the way Pages works internally and making use of Custom Hostnames. I absolutely agree it should be called out in the documentation, and I created an internal ticket to track that addition last time I came across it. Will make sure to revisit it
Ahn
AhnOP•16mo ago
thank you 🙂 I will stick to Worker solution for now then.
Want results from more Discord servers?
Add your server