Can I use SPACES as the DNS for my webpage?

January 4, 2018 1.2k views
DNS

Since uploading public files to spaces creates addresses like https://space-name.nyc3.digitaloceanspaces.com/file.png I was wondering if it could be used with a droplet to create a webpage.

So far I tried creating an index.html file, I can access it if I go with https://myspace-name.nyc3.digitaloceanspaces.com/index.html but it won't work with just https://myspace-name.nyc3.digitaloceanspaces.com/

Is it possible to achive this?

3 Answers

As @PaoloBarbolini, currently it's not possible at all. Nginx would be the best solution, and there's a tutorial on the Community that should help you: How To Proxy DigitalOcean Spaces with Nginx on Ubuntu 16.04.

DigitalOcean plans to add such features to Spaces soon, but in meanwhile, you can vote for it and leave your feedback on the UserVoice page:
Host entire static site from Spaces (like S3/GitHub Pages).
Allow custom domain alias for Spaces.

by Brian Boucheron
DigitalOcean Spaces is an object storage service that is compatible with the S3 API. In this tutorial we will show you how to use Nginx to proxy requests for objects on your Space....

At the moment spaces doesn't support website hosting, so you can't send requests directly to the spaces endpoint and expect index.html to be served when you don't put it in the url, but you could do that by sending the request to a droplet and proxing it with nginx or varnish to the spaces endpoint.
This would allow you to modify the request and append "index.html" to the requested url, making your spaces bucket behave like a normal website.

What if I have a CDN in front?

Have another answer? Share your knowledge.