4

I have set up a static website by following this walkthrough:

https://docs.aws.amazon.com/AmazonS3/latest/dev/website-hosting-custom-domain-walkthrough.html

I can see the website by accessing its bucket address (example.ca.s3-website-us-east-1.amazonaws.com). But when I try to access the website using my domain address (example.ca), it gives me ERR_TIMED_OUT. I have purchased my domain from dreamhost, and had already changed the nameservers to those nameservers shown by Route53. I did a whois query of my domain and it just confirms that the nameservers are set properly. I am wondering what the issue can be, and how I can resolve it. I have checked the NS and A records in Route53 multiple times, and they follow the instruction. Can the issue be due to my domain being a .ca one?

migrated from superuser.com Oct 17 '18 at 20:24

This question came from our site for computer enthusiasts and power users.

  • 1
    When you say it does not work, what error exactly are you getting in the web browser? Is it a "ERR_NAME_NOT_RESOLVED" or an HTTP error of some type? – Maximillian Laumeister Oct 20 '18 at 14:59
  • 1
    Also, as far as I know the .ca domain extension is just the same as any other extension, so there would be no reason for it to cause an issue. – Maximillian Laumeister Oct 20 '18 at 15:02
  • It gives me a ERR_TIMED_OUT error. I can ping the domain though. – Ali Alavi Oct 20 '18 at 15:05
  • Are you trying to access it by HTTP or HTTPS? When you try to access via one versus the other, do they both time out? (Or does one redirect to the other, then time out?) – Maximillian Laumeister Oct 20 '18 at 15:10
  • 2
    Thanks, @MaximillianLaumeister. Your queries lead me to dig a bit deeper. It turned out I had to not only clear the browser DNS cache (chrome://net-internals/#dns), but also the HSTS settings of my browser (chrome://net-internals/#hsts). So the issue was not from the server at all. I had already tried it with other browsers and devices to make sure the issue is not with my client, but as it turned out, all the test clients had also the old domain settings cached :) – Ali Alavi Oct 20 '18 at 15:26
3
+50

It turned out that HSTS headers were being served by the previous hosting. HSTS set all HTTP requests to example.ca to be internally redirected to HTTPS before being sent.

Because custom domain HTTPS was not yet configured for the S3 bucket, the HTTPS request was timing out. Note that S3 does not support custom domain HTTPS directly, only through CloudFront.

The solution to this while in development is to clear the browser's HSTS cache for example.ca in settings. However when the new website is published, it will need to be served over HTTPS so that visitors who have HSTS already cached in their browsers are still able to load the site. The only solution to this is to use CloudFront or another reverse proxy / CDN (such as CloudFlare) to manage the custom domain HTTPS certificate.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.