By Jack9
I use do spaces on my site www.example.com without a subdomain. The setup looks like this:
DO_SPACES_KEY=key
DO_SPACES_SECRET=secret
DO_SPACES_ENDPOINT=https://fra1.digitaloceanspaces.com
DO_SPACES_REGION=fra1
DO_SPACES_BUCKET=bucketname
When uploading images everything works fine and images url looks like Bucketname.fra1.digitaloceanspaces.com/imagename
Now I found out that you can use subdomain on your space. I configured everything by creating cname on Cloudflare that points to the origin endpoint, installed the certificates from Cloudflare to DO and the subdomain endpoint was set like images.example.com
My question is how do I configure DO spaces to use this subdomain endpoint instead of the origin one? So I can be able to upload images to images.example.com instead of uploading to bucketname.fra1.digitaloceanspaces.com
Thanks.
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!
Hi there @Jack9,
I believe that you will still have to use the https://fra1.digitaloceanspaces.com as the endpoint when uploading files, however, your images will be accessible via your subdomain name as well.
What you need to do is configure your subdomain name as the CDN endpoint as described here:
https://www.digitalocean.com/docs/spaces/how-to/customize-cdn-endpoint/
Regards, Bobby
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.