Using Amazon S3 Image hosting with Digital Ocean

October 22, 2015 5.3k views
Ruby on Rails DigitalOcean Ubuntu

When I use Amazon S3 Image storage, the images have their own urls instead of having urls at my website.

If I want the images to have a url on my website and use Amazon S3 at the same time with DigitalOcean. (For example myweb.com/images/image1.jpg). Is that possible?

If it isn't possible then are there other alternatives to getting the same results?

2 Answers

In order to serve content from S3 using your domain name, you can set up a CNAME record pointing a subdomain to your S3 bucket. For instance, you could use something like:

images.myweb.com CNAME          my.bucket.name.s3.amazonaws.com.

For more info, check out the Amazon S3 docs: Customizing Amazon S3 URLs with CNAMEs

Is Digital Ocean got connectivity issue with Amazon AWS? My sites got very slow access to there.

Have another answer? Share your knowledge.