title: Multiple Subdomains, Multiple Heroku App and Cloudflare
body: <p>I have a bit of a DNS/Configuration issue. I don't know if SO is the proper stackexchange network to post this.</p>
  
  <p><strong>My Setup</strong></p>
  
  <p>I use Heroku for hosting and Cloudflare for DNS Management.</p>
  
  <pre><code>Domain          Heroku                 Cloudflare DNS Settings
  example.com     example.herokuapp.com  CNAME: example.com=&gt;example.herokuapp.com
                                         CNAME: www=&gt;example.herokuapp.com
  
  sd1.example.com sd1.herokuapp.com      CNAME: sd1=&gt;sd1.herokuapp.com
  sd2.example.com sd2.herokuapp.com      CNAME: sd2=&gt;sd2.herokuapp.com
  sdn.example.com sdn.herokuapp.com      CNAME: sdn=&gt;sdn.herokuapp.com
  </code></pre>
  
  <p><strong>My Problem</strong></p>
  
  <p>I can access example.com and www.example.com from my browser but the subdomains are gives me Cloudflare error 502. On the Heroku settings page, I have added the domains to the app below is what I have</p>
  
  <pre><code>Domain Name                DNS Target
  sd1.example.com            sd1.example.com.herokudns.com
  sd2.example.com            sd2.example.com.herokudns.com
  sdn.example.com            sdn.example.com.herokudns.com
  </code></pre>
  
  <p>I know i can use the herokudns or herokuapp for the CNAME but none of it is working.</p>
  
  <p>Please help me find what I'm missing or doing wrong.</p>