简体   繁体   中英

AWS CloudFront CNAME and Distribution Domain Name relation is ambiguous

I have two Cloudfront distributions: A and B. These distributions have different CNAMEs however they point to the same origin.

Distribution A CNAMES:

foo.test.com
another.bar.com

Distribution B CNAMES:

baz.test.com
another.random.com

Calling distribution A domain with distribution B host works correctly for some reason, and vice versa:

curl https://DISTRIBUTION_A.cloudfront.net -H "Host: baz.test.com" #works
curl https://DISTRIBUTION_B.cloudfront.net -H "Host: foo.test.com" #works

Question: What is the purpose of having different distribution domains, when calling any domain with any distribution CNAME works?

CloudFront uses a shared IP space and differentiate distribution based on HOST header.

curl https://DISTRIBUTION_A.cloudfront.net -H "Host: baz.test.com" #works

Using above command, DISTRIBUTION_A.cloudfront.net is only used for IP resolution but the host header is baz.test.com and content will be served from this distribution.

(in https, it checks the SNI value in client HRLLO to match the CNAME filed to serve you the certificate of correct distribution).

It is expected from CDN services.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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