- Newest
- Most votes
- Most comments
While using S3 for personal content with HTTP might seem sufficient, you're correct that many modern browsers now require HTTPS for security reasons. To set up HTTPS for your S3-hosted website, you'll need to use CloudFront, as S3 website endpoints don't support HTTPS directly.
Here's a step-by-step approach to resolve your issues:
-
CloudFront Distribution: It's good that you've created a CloudFront distribution for your S3 bucket. Make sure you've configured it to use HTTPS. In the distribution settings, set the "Viewer Protocol Policy" to "Redirect HTTP to HTTPS" or "HTTPS Only".
-
SSL/TLS Certificate: For HTTPS, you need a valid SSL/TLS certificate. You mentioned trying to request a certificate through Amazon Certificate Manager (ACM). If you didn't receive the verification email, check the following:
- Ensure you've requested the certificate in the US East (N. Virginia) region, as CloudFront requires certificates to be in this region.
- Check if the email was sent to the domain registrant, administrator, or technical contact listed in the WHOIS record of your domain.
- Look in your spam folder.
- If you still don't receive it, you can use the DNS validation method instead, which doesn't require email verification.
-
Route 53 Configuration: To point your domain to the CloudFront distribution:
- Create an A record in Route 53.
- Choose "Alias to CloudFront distribution" as the record type.
- Select your CloudFront distribution from the dropdown list.
-
CloudFront Origin Settings: Ensure your CloudFront distribution is correctly pointing to your S3 bucket. If your S3 bucket is configured as a website endpoint, use the S3 website URL as the origin, not the bucket URL.
-
Wait for Propagation: After making changes, it can take some time (usually up to 24 hours) for DNS changes to propagate globally.
By following these steps, you should be able to serve your S3-hosted content over HTTPS using your custom domain. Remember to update any absolute URLs in your content to use HTTPS instead of HTTP.
Sources
Website endpoints - Amazon Simple Storage Service
WKLD.13 Require HTTPS for all public web endpoints - AWS Prescriptive Guidance
Require HTTPS for communication between CloudFront and your Amazon S3 origin - Amazon CloudFront
Community | Hosting my Static Website in an AWS S3 Bucket + CloudFront— Part 2
Hello.
ACM changed the specifications for email validation around June 2024.
This may be the reason why you are not receiving emails.
https://docs.aws.amazon.com/acm/latest/userguide/email-validation.html
ACM no longer supports WHOIS email validation for new certificates or renewals. Common system addresses remain supported. For details, see blog post.
If you manage your domain with Route 53, I recommend using DNS validation.
If you use Route 53, it provides an option to easily create a CNAME record for DNS validation.
https://docs.aws.amazon.com/acm/latest/userguide/dns-validation.html
Relevant content
- asked 2 years ago
I got the certificate issued. But when I went to Route 53 to create an A record, choosing "Alias to CloudFront distribution", there was no CloudFront distribution available to choose from, even though one has been made.