2

I am following the Setting up a Static Website Using a Custom Domain tutorial to the letter but something doesn't work and I don't know how to debug it.

Custom domain bought on Namecheap: sankey.app

1/ The DNS of sankey.app is correctly directing to AWS - I can see in debug tools the SOA points to ns-63.awsdns-07.com.

2/ The bucket is correctly configured, the index.html is statically hosted: http://sankey.app.s3-website-us-east-1.amazonaws.com/

3/ The Alias is created (with another one for www.sankey.app, but that should not be relevant). enter image description here

But http://sankey.app/ returns Connection Timeout and even the protocol changes to https.

Now, I have experimented with https and CloudFront before but it didn't work so I disabled and deleted the distribution. There no active CloudFront distribution associated with the domain or bucket.

How can I debug this situation? I am a newbie and I am really helpless.

daniel.sedlacek
  • 123
  • 1
  • 5
  • 1
    According to mxtoolbox, the A records for both resolve to AWS, so it's probably not DNS. I can access the S3 bucket directly, but not via your domain. Puzzling! – Tim Nov 28 '18 at 18:07
  • Odd. `curl sankey.app` returns a response, nearly instantly. – ceejayoz Nov 28 '18 at 18:49

1 Answers1

3

Your site is not configured to serve content over HTTPs but because of this Chrome trickery your are being silently forced to HTTPs.

Your domain is on the list of HSTS preloaded sites.

https://hstspreload.org/?domain=sankey.app

This is the reason why it works from curl and not in Chrome

In Chrome, right click -> Inspect -> Network Tab and then load http://sankey.app you will see 307 redirect.

enter image description here

You will need to configure CloudFront distribution to terminate SSL for your S3 bucket or request removal from HSTS which takes ages (see hstspreload.org page)

Andrey
  • 558
  • 2
  • 8
  • Very nice catch. – ceejayoz Nov 29 '18 at 02:54
  • How do I configure CloudFront distribution to terminate SSL for your S3 bucket? Your help is really appreciated. – daniel.sedlacek Nov 29 '18 at 18:02
  • This should help : https://aws.amazon.com/premiumsupport/knowledge-center/cloudfront-serve-static-website/ or this https://medium.com/@brodartec/hosting-a-static-site-with-https-enabled-using-aws-s3-cloudfront-and-godaddy-826dae41fdc6 its a common setup – Andrey Nov 29 '18 at 22:10
  • It worked, except I could not add the CNAME record next to the A record. In the end, I realized I need to change the A from the bucket to the CloudFront distribution. Heureka! – daniel.sedlacek Nov 30 '18 at 17:58
  • Nice one, good work. – Andrey Nov 30 '18 at 22:49