Cloudflare serves content from domain instead of subdomain?!

I have a domain and subdomain setup, and they have different content, e.g. subdomain.example.com and example.com.
I have set up a CNAME like this: www -> subdomain.example.com.

The content is served correctly under subdomain.example.com, I can select the text in the cloudflare DNS settings and right click and do open in new tab, and it’s showing the content.
However, cloudflare is serving the content from example.com and not subdomain.example.com!
How can this happen?
The domain doesn’t appear anywhere in cloudflare config, how can it end up serving the wrong content?

Without knowing the domain and subdomain in question, there’s no way for us to provide any useful suggestions.

Thanks for taking the time looking into my problem.

The domain is jeverling.de, the subdomain (origin) is payfortheamazon.jeverling.de.
Cloudflare is supposed to serve the content of payfortheamazon.jeverling.de on https://www.payfortheamazon.com/, but serves the content of jeverling.de instead.

The jeverling domain and subdomain are not on Cloudflare. Which I believe is your plan.

If you set the amazon one to :grey:, does it show the proper content?

Is this a free plan, or is it a paid plan? Those have different CNAME flattening options.

1 Like

If I set it to DNS only, it’s also showing the wrong content. So it seems to be a DNS problem.
Thank you! I will resolve it by reverting to using a Gitlab pages origin, which was working fine before I only changed because it was showing 404 all of a sudden, but that problem seems to have fixed itself.

I don’t think it’s DNS. It’s the origin server that’s receiving the request, but not serving the correct content. The Server block of Apache (or NGINX) isn’t configured to respond to that hostname.

That would make sense. But it did work when I requested the subdomain using a browser or curl, I got the correct content. So the configuration appeared to be correct. I have given up on it though and reverted to gitlab pages. Thanks again for your help!

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