Subdomains on Cloudflare and Heroku Subdomains on Cloudflare and Heroku heroku heroku

Subdomains on Cloudflare and Heroku


I managed to get my domain/sub-domain mix to work over two Heroku apps. The key seems to be with Cloudflare and not Heroku.

I had things set as follows:-

CNAME www alias of app1.herokuapp.com (CloudFlare enabled)CNAME mydomain.com alias of app1.herokuapp.com (CloudFlare enabled)CNAME api alias of app2.herokuapp.com (No cloudflare)

Ensure the DNS records for your domain are set to the CloudFlare ones (may.ns.cloudflare.com and sam.ns.cloudflare.com) within CloudFlare and of course, set your Heroku DNS to pick up your domains.

Failing that, you should contact CloudFlare support, but unlike other answers here, the objective of SO is to provide an answer to a specific question first, to allow the OP to help themselves. I hope this helps.


It sounds likely to be a misconfiguration on Heroku's side, and less likely an issue on CloudFlare's side. Without being able to see your account specifics though it's hard to prove that conclusively.


Can you please open up an actual CloudFlare support ticket with the specifics here? We'd be happy to look into this further, but we do need the specific settings/real and the domain/subdomain...etc.

https://support.cloudflare.com