Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Subdomains on Cloudflare and Heroku

I have setup a cname for mydomain.com to be an alias of app1.herokuapp.com and it works. However, cname for sub.mydomain.com as an alias of app2.herokuapp.com does not work.

It does not work with either grey or orange cloud and having clicked on the "I am done" button. Any ideas?

like image 279
teslan Avatar asked May 24 '13 05:05

teslan


1 Answers

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.

like image 195
dooburt Avatar answered Oct 04 '22 11:10

dooburt