简体   繁体   English

静态网站托管中针对子域的AWS S3存储桶重定向与DNS CNAME

[英]AWS S3 bucket redirect vs DNS CNAME for subdomain in static website hosting

AWS S3 website hosting guide recommend to setup a subdomain in a way which is not clear for me AWS S3网站托管指南建议以一种我不清楚的方式设置子域

is there any reason why AWS recommend to setup an A record (alias) to an S3 bucket for the (www) subdomain and the subdomain then later redirect to another S3 bucket? 为什么有任何理由为什么AWS建议为(www)子域和该子域的S3存储桶设置A记录(别名),然后再重定向到另一个S3存储桶?

would not is be better just to setup a CNAME DNS record instead of this double redirection? 仅设置一个CNAME DNS记录而不是这种双重重定向会更好吗?

That documentation can be confusing. 该文档可能会造成混淆。

First, the redirect they're talking about is from www.example.com to example.com. 首先,他们正在谈论的重定向是从www.example.com到example.com。

Second, when setting up the A record using route53, you set it up as an "alias" to your s3 bucket. 其次,在使用route53设置A记录时,将其设置为s3存储桶的“别名”。 Internally route53 takes care of finding the IP address to associate with the A record. 在内部,route53负责查找要与A记录关联的IP地址。 However, if you use another DNS provider, you would use a CNAME record. 但是,如果您使用其他DNS提供程序,则将使用CNAME记录。

More info can be found in this blog . 可以在此博客中找到更多信息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM