[英]AWS : Redirecting www to root using Route 53 and S3 bucket
I have an application that runs on a Elastic BeanStalk under a Classic Load balancer. 我有一个在Classic Load Balancer下在Elastic BeanStalk上运行的应用程序。 I want my site to respond to example.com and also to www.example.com. 我希望我的网站对example.com以及www.example.com做出响应。 I did the following to perform that : 我做了以下操作:
This works fine. 这很好。
This works fine. 这很好。 When I navigate to http://www.example.com.s3-website-us-east-1.amazonaws.com it redirects me to example.com 当我导航到http://www.example.com.s3-website-us-east-1.amazonaws.com时,它会将我重定向到example.com
This does not work. 这是行不通的。 In Chrome, i have the following error : 在Chrome中,我遇到以下错误:
This site can't be reached www.example.com took too long to respond. 无法访问该网站www.example.com花费的时间太长,无法回复。
What am I missing ? 我想念什么?
PS: I have done nothing for www.example.com in my registrar. 附言:我对注册商中的www.example.com没有做任何事情。 Anything have to be done ? 有什么需要做的吗?
Thank you for your help. 谢谢您的帮助。
I had similar issue. 我有类似的问题。 What worked for me from discussion in that chat: 通过聊天中的讨论对我有用的是:
if not - configuration of Alias / A-record is incorrect. 如果不是-别名/ A记录的配置不正确。 Then check all permissions (S3 should be available for reading publicly; S3 bucket should be setup as Website Hosting; the bucket name should be identical to the Route 53 hosted zone name). 然后检查所有权限(S3应该可以公开读取; S3存储桶应设置为“网站托管”;存储桶名称应与Route 53托管区域名称相同)。 See all details in official AWS article here . 在此处查看AWS官方文章中的所有详细信息。
S3 Website endpoint doesn't support HTTPS so if a user access it on HTTPS, it won't work. S3网站终结点不支持HTTPS,因此,如果用户通过HTTPS访问它,它将无法正常工作。 Creating a CloudFront only for redirection can solve this but increase the work. 仅创建用于重定向的CloudFront可以解决此问题,但会增加工作量。 (CF+ACM+S3+Route53) I would suggest use a redirection rule directly on the beanstalk environment and create alias records for both www.example.com and example.com to point to ELB. (CF + ACM + S3 + Route53)我建议直接在beantalk环境上使用重定向规则,并为www.example.com和example.com创建别名记录以指向ELB。
Here is how you can do that using CloudFront 这是使用CloudFront的方法
Directly on Beanstalk 直接在Beanstalk上
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.