How to use custom domain for object storage
I'm looking to use object storage, but I'm wondering if there is a way to make it use my domain name.
I tried using a CNAME record, but I keep getting 'missing bucket' errors.
Thank you so much
Yes, you can use a custom domain with Linode Object Storage with some limitations. I have provided an overview. Details can be found here:
I will use www.example.com to illustrate. Let's pretend the bucket is in Newark (us-east-1).
Create a bucket must be labeled as your FQDN: Name your bucket www.example.com
- If your files already exist in a bucket that doesn’t have this label, create a new bucket with this label and copy your files into it.
Create a CNAME record for the site like this example.
The "website-" in front of the cluster-id is significant:
www IN CNAME www.example.com.website-us-east-1.linodeobjects.com
Initialize your bucket as a web site:
s3cmd ws-create --ws-index=index.html --ws-error=404.html s3://www.example.com
Go to the Access tab for your bucket and set the ACL to Public Read.
Create a simple index.html file in the bucket's main directory:
<html> <head> <title>Testing 1.2.3.</title> </head> <body> <h1>Hello, World!</h1> </body> </html>
6. Verify that you can browse: http://www.example.com/index.html
If there are any problems, check the permissions to ensure that index.html has the Public Read ACL and that your DNS records are resolving.
7. Get a TLS/SSL certificate for www.example.com. If you are using certbot according to the guide provided above, it will ask you to put a file in .well-known/acme-challenge/. Make sure that the file and all the directories containing it are publicly readable. Verify that you can access the file from your browser, before telling certbot to check it, otherwise you will have to create another file with a different name and contents.
8. Install the certificate for the bucket in the Cloud Manager in the bucket's SSL/TLS tab.
9. You should be able to browse the site using HTTPS now.