0
votes

I've seen a lot of manuals about this question and especially AWS' official docs

  • I created two buckets mydomain.com and www.mydomain.com.
  • I added bucket policy to mydomain.com:

    { "Version": "2012-10-17", "Statement": [ { "Sid": "AddPerm", "Effect": "Allow", "Principal": "", "Action": "s3:GetObject", "Resource": "arn:aws:s3:::mydomain.com/" } ] }

  • I enabled "Enable website hosting" for mydomain.com and put index.html there. So I've got endpoint for it mydomain.com.s3-website-us-east-1.amazonaws.com which good in opening index.html.

  • I enabled "Redirect all requests to another host name" for www.mydomain.com to mydomain.com.s3-website-us-east-1.amazonaws.com. But according to AWS' official I should do redirect to mydomain.com. But it doesn't work for me, and my way of redirect does. Anyway now www.mydomain.com.s3-website-us-east-1.amazonaws.com opens index.htm in mydomain.com.s3-website-us-east-1.amazonaws.com.

  • Mydomain registred with AWS route53, so I went there and created A Alias to s3-website-us-east-1.amazonaws.com exacly like in docs.

My route53 records are: .

I have been waiting for 24 hours, but nothing changes... So I did everything from AWS' official docs but mydomain.com goes to nowhere... Help, please.

2
When you request mydomain.com or www.mydomain.com , what kind of error do you get? - James
also, paste the output from 'host mydomain.com' and 'host www.mydomain.com'. (you can use nslookup instead of host) - tedder42
@James Sorry for delay. Error is just: Can't open the page www.mydomain.com. Can't find the server www.mydomain.com. - user3742622
@tedder42 Sorry for delay. Nslookup output is: ";; connection timed out; no servers could be reached" - user3742622
I'm having this issue right now and I'm dying over here. everything appears to be set up correctly, I have the domain name pointed at the s3 bucket alias, all files are public,NS records resolving to amazon, static website url working etc.. I've used mxtoolbox.com traceroute, and every other DNS tool I can think of and I'm getting all the way back to amazon s3.... but the request dies there and won't resolve - parallaxis

2 Answers

1
votes

You have to create a CNAME record, not an A record. When you enable redirection on your bucket, you're actually entering a bucket name, not a url - even if the bucket name is a domain.

Incidentally, I recently wrote a Node module called awsome that does what you're trying to do, with one single line of code. Check it out and let me know if it helps.

1
votes

The problem could be with the Name Servers set on your domain.

If you transferred your domain to AWS from somewhere else, you should go into route 53 and go to Registered Domain, then your domain. You'll see the nameservers listed on the right.

Make sure those match the NS records in your hosted zone.