Report this

What is the reason for this report?

DO Spaces CDN with Cloudflare custom domain

Posted on April 14, 2024

Trying to get a custom domain for my Digital Ocean Spaces Bucket, really can’t find any solution…

What I’m doing:

I’ve setup a CNAME at Cloudflare (Name: “files”, Target: bucket-name.sfo2.digitaloceanspaces.com, Proxy: Enabled, SSL/TLS: Full (strict))

I’ve created a Origin Certificate (RSA (2048), Hostnames: files.domain.com, Certificate Validity: 15yrs)

Key Format PEM Copy/Paste Origin Certificate and Private Key to:

DO - Spaces Object Storage - bucket-name/https://bucket-name.sfo2.digitaloceanspaces.com - Settings - CDN Enabled - Edit CDN - +Add a new subdomain certificate - “Bring your own certificate”:

Certificate name* mysslcertificatename

Certificate* -----BEGIN CERTIFICATE----- OrIGINcERtIFIcaTEfrOMcLOUdFLarE -----END CERTIFICATE-----

Private key* -----BEGIN PRIVATE KEY----- prIVAtEkeYfROMcLOUdFLarE -----END PRIVATE KEY-----

Certificate chain <empty>

Subdomain* files https://files.domain.com

I then click the button: “Generate Certificate and Use Subdomain”.

This is what I see in DO - Spaces - Bucket - Settings:

image alt text
image caption

I’ve previously had this setup working, but I suddenly experienced that the my custom domain CNAME was not working properly, so I disabled the CDN for the bucket and tried to enable it again. I’ve tried recreating what I did originally, but I’m not able to make it work.

It looks like there’s an issue with the SSL certificate., but I’m not really sure at this point.

I’d really appreciate some help here



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!

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.

Heya, @magnusstrand

You can double check the certificate files and make sure the SSL has not expired as well.

Also, please note that you cannot secure a CDN’s subdomain with a CloudFlare Origin CA certificate or with a custom wildcard SSL certificate that you are already using elsewhere in your account. In these cases, add a new custom certificate during the custom subdomain set up for your CDN.

https://docs.digitalocean.com/products/spaces/how-to/customize-cdn-endpoint/

Regards

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.