简体   繁体   中英

Static website on S3 with route 53 - Site can't be reached

I have hosted a static website on S3 with suitable bucket policy set. Viewing the "endpoint" in another tab works perfectly fine. After this I created a Hosted zone in route 53 to give it a desirable human readable address.

After creating the hosted zone, I have two records in my newly created hosted zone, One being of type NS and the other being of type SOA . So far so good. I go ahead to create a new record set.

I add the name as desired, enter type as 'A' - IPv4 Address tick yes for Alias , where in the drop down ( Alias Target ) i can see my previously created bucket endpoint .

I set the routing policy to be simple and Evaluate Health Target set to no. The record set is created successfully. However when i enter this name in another tab, I get the "Site can't be reached". I try and test the record set using the functionality provided by AWS. Here the response code i get is "NOERROR" which i assume is a positive response. Am I missing something here.

I have also referred to this video. Am I missing something. Also, I have not created the Hosted Zones myself.

A hosted zone is not the same as domain. You have to update the NS values for your domain registrar to point to the NS values as generated by Route53.

From the docs :

When you create a hosted zone, Amazon Route 53 automatically creates a name server ( NS ) record and a start of authority ( SOA ) record for the zone. The NS record identifies the four name servers that you give to your registrar or your DNS service so that DNS queries are routed to Amazon Route 53 name servers.

[...]

After you update the settings with your domain registrar to include the Amazon Route 53 name servers, Amazon Route 53 responds to DNS queries for the hosted zone even if you don't have a functioning website.


NS transfer may take from 1 to 24 hours, depending on the registrar.

I faced the same issue. I bought domain thevegfoodies.com through AWS Route 53, created simple index.html page and uploaded to bucket thevegfoodies.com and set bucket for Static website hosting ,added public policy. created second bucket www.thevegfoodies.com and redirect to thevegfoodies.com , created aliases everything , read through documents everything. But nothing worked. Until, i realized that my redirect bucket www.thevegfoodies.com was not set for public read access. I set it too Read bucket permissions for Everyone . (Note my primary bucket thevegfoodies.com already has public access.) and i could load my website using my domain name.

Now, I have read through AWS document again just to see if I missed this step of setting up public access for redirection bucket. https://docs.aws.amazon.com/AmazonS3/latest/dev/website-hosting-custom-domain-walkthrough.html and all other steps to setup static website. if you check Step 2.3: Configure Your Website Redirect, it is not mention that we need to set public access.

POINT- AWS Documentation is not clear. One need to have public access to redirect bucket too.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM