Question

Point subdomain in CloudFlare to Digital Ocean droplet

Posted March 16, 2020 787 views
DNS

I would like to have SSL (https) in my droplet and I understand this is not possible without using a subdomain / domain pointing to the droplet IP.

I have a domain using Cloudflare and I would like to create a subdomain pointing to my Digital Ocean droplet. (using test.example.com)

When I do so without using the Cloudflare “proxied” option, it all works well:

A —— test —— DROPLET_IP — DNS ONLY (not proxied)

However, when I use the orange cloud icon (proxied) then it won’t work.

Why is that?

Also, I noticed there’s a “Networking” tab in Digital Ocean where we can add a domain.
Do I need to do anything there in this case ? Or should I manage everything through CloudFlare?

I’m not used to deal with these things and I get a bit lost in here :)

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

×
2 answers

Hi there @mrstevejobs,

If your domain name uses Cloudflare’s Nameservers, you do not have to add your domain name under the Network section in DigitalOcean, as it would not have any effect. Your domain name would use only the DNS zone that your Nameservers are pointing to.

Regarding your subdomain name, yes if you set the A record of your subdomain name to point to your Droplet without Cloudflare proxy, then you will basically be able to use Let’s Encrypt and issue an SSL for your Droplet.

If you enable the Proxy setting in Cloudflare, what this essentially does is to change your A record to a Cloudflare IP address and then in the background Cloudflare would proxy the traffic to your Droplet’s IP address, but your subdomain name A record would be pointed to a Cloudflare IP and Let’s Encrypt would not work. Though if you keep the Proxy setting, you should be able to use an SSL provided by Cloudflare.

Hope that this helps! Let me know if you have any questions.
Regards,
Bobby

I have the same problem.
After i change the cloudflare to full SSL, the site works properly.

Submit an Answer