Subdomain redirecting to primary domain

I have a site which has 12 subdomains. I’ve set each of those up as their own A RECORD, an IP and they are set to be proxied. They all point at the same server.

I’ve created an Origin Certificate and installed it on my server.

However when I try and visit any of these subdomains, it always redirects me to my main www.domain.com route. As far as I can tell this is happening entirely in cloudflare, and it’s not touching my server at all.

Yet if I set up a wildcard entry and point it at my server, any subdomains caught by that get directed through as expected.

I have 4 A RECORD entries for my primary domain which all point at different IP addresses, these combined with a couple of CNAME entries are from squarespace’s configuration for my root domain.

Any ideas why the hard coded subdomains are redirecting?

Set them to DNS-Only and see if they work correctly. Let us know if that fixes it.

Okay have taken them all off proxied, and set them to be DNS only, got a bit concerned as it gave warning triangles on them all saying they were exposing my IP, until I had done them all… now all warning triangles have gone, but the subdomains are still redirecting…
e.g.
https://vuw.edukudu.com

The redirect is definitely coming from your server. Not Cloudflare.

Ah, interesting, wonder where that’s kicking in, must be happening at the nginx level.
Thanks.

Many thanks, solved it now. It was related to how my server was set to handle wildcard subdomains on my alias domain. But I wouldn’t have got to that point without the pointer about turning off the proxies.

1 Like

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