Route53 的 AWS S3 重定向不适用于 HTTPS [英] AWS S3 Redirect for Route53 not working for HTTPS

查看:34
本文介绍了Route53 的 AWS S3 重定向不适用于 HTTPS的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用 AWS S3 静态网站重定向来允许从 Apex 域 (example.com) 重定向到 ]

因此您需要在 example.com s3 存储桶前面添加一个 CloudFront 并配置指向它的正确 DNS 记录

I am attempting to use AWS S3 Static Website Redirect to allow redirects from an Apex domain (example.com) to the www.example.com domain.

I used the following guide https://medium.com/faun/redirect-naked-domain-to-www-with-https-on-aws-route-53-e620e4ce989d

In Route53, I have created an A record for the apex domain example.com

example.com    A    Simple   s3-website-eu-west-1.amazonaws.com.

The www.example.domain points to a cloudfront distribution which distributes my website. The cloudfront domain will redirect all HTTP traffic to HTTPS

www.example.com   A    Simple    *************.cloudfront.net.

In S3, I have created a bucket for example.com and set it up to redirect all requests [ The bucket is public and empty

The resulting behavior works for HTTP but times out for HTTPS

http://example.com -> https://www.example.com
https://example.com -> ETIMEDOUT
http://www.example.com -> https://www.example.com
https://www.example.com -> https://www.example.com

How can I fix this setup so that https://example.com -> https://www.example.com

解决方案

The issue is S3 static website hosting doesn't support HTTPS. [ref]

So you need to add a CloudFront in front of example.com s3 bucket and configure proper DNS records pointing to it

这篇关于Route53 的 AWS S3 重定向不适用于 HTTPS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆