Page 1 of 1

Subdomain + Cloudflare = Site can't be reached

Posted: Sun May 29, 2016 8:49 pm
by tiptoptommy
I've been using VestaCP for a few months and have been able to solve my problems via google and this forum. But despite this being a common topic here, I am slightly lost.

I have done the following.

I set up the subdomain as outlined http://stackoverflow.com/questions/2590 ... gitalocean.
I have pointed an A Name record at the server IP in CloudFlare.

Things I've tried.
Removing the alias for the sub domain.
I've restarted apache and nginx via ssh.

I am at a loss as what to look at next. Any advice?

Re: Subdomain + Cloudflare = Site can't be reached

Posted: Mon May 30, 2016 12:51 pm
by skamasle
You not need more, so only add subdomain in vestacp has new domain and point A record to IP.

The problems:

- Maybe you dont point to correct IP.
- Maybe you add incorrect subdomain

Doble check to that points, be sure than your subdomains dont was added to private digitalocean ip ( 10.x.x.x )

Re: Subdomain + Cloudflare = Site can't be reached

Posted: Mon May 30, 2016 3:05 pm
by joshmarshall
What I've done in the past is to set up a subdomain to use with cloudflare, but instead of pointing A record as you have, I pointed NS records.

So if you had testdomain.com

Create subdomain cdn.testdomain.com

Inside the testdomain.com create

cdn NS ns1.cloudflare.com.
cdn NS ns2.cloudflare.com.

You will get different names for ns1 and ns2 at cloudflare.

What this ensures is that anything at testdomain.com does not go through cloudflare but everything cdn.testdomain.com does. I use this to make sure that passwords etc don't go through cloudflare but assets are served by their cdn.

Re: Subdomain + Cloudflare = Site can't be reached

Posted: Tue May 31, 2016 5:17 am
by tiptoptommy
Thank you very much to the two replies above. My issue was, it turns out, a lack of patience with DNS propagation.

And thanks to @joshmarshall, I was not aware that we could selectively apply cloudflare to subdomains.