3

This should be easy as there is no shortage of pages on custom domains and S3 but for some reason I can't seem to get it to work as expected.

I have a S3 Bucket full of videos. The S3 bucket is called for example "videos.foo.com". I bought the domain "videos.foo.com" and set it up in cloudflare with the cname "videos.foo.com" pointing to "videos.foo.com.s3-website-us-east-1.amazonaws.com".

I can view files in my bucket by going to there full url such as "videos.foo.com.s3-website-us-east-1.amazonaws.com/myvideo.mpg".

My problem is I can't view them by going to "videos.foo.com/myvideo.mpg".

I tried enabling "Redirect all requests to another host name" and entering "videos.foo.com" but that didn't work either. To note, I will 'not' be hosting a site at "videos.foo.com" just serving files.

All the files have permissions everyone: open/download.

If anything sees the error in my ways please let me know. In the mean time I'll keep searching and going through trial and error. Thanks!

TechRemarker
  • 2,788
  • 11
  • 37
  • 60
  • 1
    That's still "hosting a site" for purposes of discussion. Enable static website hosting on the bucket, as usual... and if still no joy, then you likely have a DNS issue that you'd troubleshoot with a standard tool like `dig`. – Michael - sqlbot Oct 09 '14 at 01:54
  • Yes, I had tried "Enable Static Website Hosting" as well but had no luck. I'm sure it's a setting in AWS or something that needs to be changed in the DNS, but don't know what. Depending on the settings in AWS it either shows a blank page, or an aws error saying the site is not setup, or it says infinite loop. So DNS is pointing to AWS, but it's finding the exact combination to get it to work as expected that's the problem. – TechRemarker Oct 09 '14 at 12:16

2 Answers2

1

Nginx S3 proxy helps to solve that problem, please check more details: https://stackoverflow.com/a/44749584/290338

A bucket can be named differently, the only performance rule is to have EC2 and a bucket in the same geo location.

Anatoly
  • 15,298
  • 5
  • 53
  • 77
0

You may need to configure the Route 53 record as an alias rather than a cname. In R53, edit your record set and configure it like this -

Type: A - IPv4 address
Alias: Yes

When you click in the Alias Target textbox it will drop down a list that contains your S3 bucket (if it's properly configured). It can take a while to load that list so be patient. Select your bucket and hit save.

Check out this document for more info - http://docs.aws.amazon.com/AmazonS3/latest/dev/website-hosting-custom-domain-walkthrough.html

David Fevre
  • 844
  • 6
  • 10