1

Documentation

Offers only HTTP, how to make it to work on HTTPS? Is it possible?

enter image description here

I configured and it is working fine for HTTP, but for HTTPS I'm getting

This site can’t be reached

Even though I created certificates to my domain in AWS Certificate Manager.

Yevgeniy Afanasyev
  • 37,872
  • 26
  • 173
  • 191
  • It'll work on HTTPS also... You need to import your HTTPS certificate in AWS Certificate Manager – Akber Iqbal Jan 03 '19 at 03:35
  • I have a certificates assigned to my site in `Certificate Manager` but I'm getting "This site can’t be reached" – Yevgeniy Afanasyev Jan 03 '19 at 03:37
  • Assuming that you have a custom domain name, You have defined mapping in route53, Which takes your URL and maps to an s3 bucket? – Akber Iqbal Jan 03 '19 at 03:39
  • Yes it is done, and working for http, https does not work even before mapping when it is `https://example.com.s3-website.us-east-2.amazonaws.com/` – Yevgeniy Afanasyev Jan 03 '19 at 03:42
  • "This site can’t be reached" mentioned above is what I get instead of a static page. – Yevgeniy Afanasyev Jan 03 '19 at 03:53
  • First you need to know that you did an http:// bucket configuration. Therefore only http:// is functional. What you are trying to do is create an alias. I'm sure the S3 does support Aliasing however you should learn how to configure https:// as an Alias. – Juniar Jan 03 '19 at 04:01
  • Update the Record Sets for Your Domain and Subdomain Now that you have successfully created a CloudFront distribution, update the A records in Route 53 to point to the new CloudFront distribution. To update A records to point to a CloudFront distribution Open the Route 53 console athttps://console.aws.amazon.com/route53/. On the Hosted Zones page, choose the hosted zone that you created for your domain. Choose Go to Record Sets. Choose the A record that you created for the www subdomain. For Alias Target, choose the CloudFront distribution. Choose Save Record Set. To redirect the A re – Juniar Jan 03 '19 at 04:17
  • I did not create a CloudFront distribution, CloudFront was not mentioned in the instruction that I used and quoted. Should I? Is it the best practices? – Yevgeniy Afanasyev Jan 03 '19 at 11:45
  • I wrote an article that explains how to, correcly, use CloudFront to force HTTPS-only in front of S3. “Deploy a static web application on AWS, the right way” https://link.medium.com/ZfnOwNddXV – drAlberT Apr 17 '19 at 06:51

2 Answers2

1

CloudFront can be used to serve HTTPS request for static website hosted on S3. Here is some AWS documentation https://aws.amazon.com/premiumsupport/knowledge-center/cloudfront-https-requests-s3/

Also, i found this blog very explanatory - https://medium.com/@sbuckpesch/setup-aws-s3-static-website-hosting-using-ssl-acm-34d41d32e394

Hope this helps.

Pradeep Bhadani
  • 4,435
  • 6
  • 29
  • 48
  • Thank you, but I was told that answers containing only collection of links should not be accepted. Links die, or information changes there. And the useful information can be lost and previously up-voted answer will become useless... – Yevgeniy Afanasyev Jan 03 '19 at 21:09
0

To configure HTTPS for Static website hosted using S3 as Web site feature, you have to configure AWS CloudFront to serve the website from the CDN locations and ACM can be configured on CloudFront distribution.

Create the Route 53 record set pointing to CloudFront Distribution Endpoint

This way you can server the S3 website on HTTPS and also it will reduce latency as well to your end users request.

Hope this helps

Lakhan Kriplani
  • 464
  • 3
  • 9