Question

How to Set up a Custom Domain on Cloudflare for Digitalocean Spaces + CDN

I was following the documentation about how to add a custom subdomain as a CDN endpoint to DigitalOcean Spaces: docs.digitalocean.com/products/spaces/how-to/customize-cdn-endpoint/#add-a-custom-subdomain

The steps I took following this documentation were as follows:

  1. I created a new DigitalOcean Spaces Bucket with enabled CDN.
  2. I created a new SSL origin certificate in my Cloudflare settings for the subdomain that I want to use: cdn.domain.com
  3. I added the new subdomain to my Spaces Bucket filling in the certificate information from Cloudflare.
  4. I added a CNAME DNS record to Cloudflare to point the subdomain to the default CDN endpoint: cdn.domain.com > spacesbucket.cdn.digitaloceanspaces.com
  5. I uploaded a file to the Spaces Bucket to test the configuration.

The result:

I can access the uploaded file via the default CDN endpoint, but I cannot do so via the subdomain endpoint.

I receive either a Cloudflare Error 1014: CNAME Cross-User Banned message or a cdn.notionunpacked.com’s DNS address could not be found. Diagnosing the problem. error message.

I tried turning the Cloudflare proxy status for the CNAME record off and on. It doesn’t work with either of these settings.


Submit an answer


This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

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.

I was told that DigitalOcean Spaces can’t automatically renew SSL certs unless you use DigitalOcean for the root nameservers. It sounded like it isn’t really feasible to use the Spaces product with Cloudflare, since Cloudflare requires you to use their DNS. I can’t stop using Cloudflare, so it’s a bit limiting.

hi @consistentbenny ,

Cloudflare Origin Certificates are only valid for encryption between Cloudflare and your origin server.

alexdo
Site Moderator
Site Moderator badge
April 16, 2023

Hello @consistentbenny

Please remember that DNS changes might take time to propagate, so allow some time after making adjustments for changes to be reflected globally. Usually this will happen straight away but it might take up to 24 hours for the DNS to update properly.

You can check that the DNS is working properly using our DNS lookup tool

https://www.digitalocean.com/community/tools/dns

Regards

Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

Get our biweekly newsletter

Sign up for Infrastructure as a Newsletter.

Hollie's Hub for Good

Working on improving health and education, reducing inequality, and spurring economic growth? We'd like to help.

Become a contributor

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

Welcome to the developer cloud

DigitalOcean makes it simple to launch in the cloud and scale up as you grow — whether you're running one virtual machine or ten thousand.

Learn more
DigitalOcean Cloud Control Panel