要将区域顶点路由到 Cloudfront,我是否必须使用 Amazon 的“53”DNS 服务?
这是一个非常令人惊讶的限制。如果没有其他选择,我必须移动 DNS 服务并更改 SSL 证书。
例如:
dev.myapp.com ---- CNAME ----> s3 location // works great
stage.myapp.com -- CNAME ----> Cloudfront Location // works great
myapp.com -------- ALIAS ----> Cloudfront Location // Issa no worky so good
If you're using Amazon Route 53 as your DNS service, you can create an alias resource record set instead of a CNAME. With an alias resource record set, you don't pay for Route 53 queries. In addition, you can create an alias resource record set for a domain name at the zone apex (example.com) http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/CNAMEs.html
Cloudfront dist on top level domain
除了使用 Amazon 53 之外还有其他选择吗?
最佳答案
我从 DNSimple 的 Darrin 那里得到的有用建议是:
Hi,
The trouble with an ALIAS record and CDNs is it will resolve to an endpoint closest to our name servers rather than the normal behavior which is resolving to an endpoint closest to the client.
You might get a little better performance using our Anycast network since we our name servers are distributed closer to the client already. That said -- I would probably recommend against using an apex record with a CDN in any case.
If you're using a CDN I would probably use a URL redirect from the apex to the CNAME "www".
所以完整的设置是:
dev.myapp.com ---- CNAME ----> s3 location
stage.myapp.com -- CNAME ----> Cloudfront Location
www.myapp.com ---- CNAME ----> Cloudfront Location
myapp.com ----- REDIRECT ----> www.myapp.com
我担心性能影响,但我想我们可以衡量这些影响并使用react。
关于alias - 将区域 Apex 域路由到 Amazon Cloudfront,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18494077/