Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use Digitalocean Spaces Subdomain with CloudFlare FREE SSL?

I am using Spaces S3 storage on DigitalOcean. To add a subdomain for my Spaces, an SSL certificate is required to be uploaded. I am trying to use the Cloudflare Free Edge SSL certificate, and forward my requests from my subdomain.company.com to Spaces Endpoint.

like image 908
K Manoj Kumar Avatar asked Dec 02 '22 09:12

K Manoj Kumar


2 Answers

I've figured it out, this is how it works for me.

  1. Create a DigitalOcean Space with the CDN option selected. The space name must match the fully-qualified subdomain you want to use, e.g. cdn.example.com if you were using that domain.
  2. Create the desired CNAME for your DO CDN on Cloudflare. For the CNAME record value use the CDN endpoint value provided by DO. Keep the "proxied" toggle on.
  3. Use Cloudflare Dashboard to create origin server self-signed SSL Cert specifically for the CNAME (Custom domain) created in step 2.
  4. Use DO Spaces CDN option to add a new subdomain SSL certificate created from Step 3. Add Name, Cert, Key, and your Custom Domain value and Save.
  5. Done! Cloudflare is now proxying your DO CDN domain, and your files on DO Spaces can be served on a Custom Domain.
like image 54
K Manoj Kumar Avatar answered Dec 06 '22 03:12

K Manoj Kumar


I was still running into issues with Manoj's solution. Eventually I was able to resolve it. The problem was that the space name must match the custom subdomain exactly, e.g.:

cdn.example.com
like image 43
Paul Kuhle Avatar answered Dec 06 '22 03:12

Paul Kuhle