Using third-part cdn for Cloudflare Pages to access it in China

In view of the extremely slow access to Cloudflare Pages in mainland China, I try to use a Chinaese cdn to speed it up.
I added the CNAME given by the cdn service provider to the custom domain of Cloudflare Pages, but Cloudflare displays:Inactive (Requires DNS setup), and when accessing the accelerated domain name (not its CNAME), it displays Direct CNAME / IP access is not allowed. A valid hostname must be used to reach the corresponding website.
What should I do to fix it?

I set the back-to-source address of the CDN to <something>.pages.dev, which I forgot to mention in the question

I waited for a few hours and the original error ( Direct CNAME / IP access is not allowed. A valid hostname must be used to reach the corresponding website. ) disapeared and was replaced by Error 1001:

You’ve requested a page on a website () that is on the Cloudflare network. Cloudflare is currently unable to resolve your requested domain (). There are two potential causes of this:

  • Most likely: if the owner just signed up for Cloudflare it can take a few minutes for the website’s information to be distributed to our global network.
  • Less likely: something is wrong with this site’s configuration. Usually this happens when accounts have been signed up with a partner organization (e.g., a hosting provider) and the provider’s DNS fails.

The CDN can’t be requesting the IP itself - http://192.0.2.1 won’t send over the correct SNI/Host header to tell Cloudflare what hostname to query.

This is seemingly how you have it set up right now, so you need to configure the CDN to request with the correct SNI / Host header set to your CF pages domain. This is commonly referred to as domain fronting, which might not be available from the CDN you’re trying to use (since performing this domain fronting is generally considered bad manners and would enable people to re-host content they don’t own).

Thank you!
I change a CDN and solve the problem.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.