- Newest
- Most votes
- Most comments
Thank you for the great details. Please allow me to explain with examples, assuming we have:
Sub-domain: cf.example.com
Staging: d123.cloudfront.net
Production: d456.cloudfront.net
Status: alternate domain names was re-assigned to d456.cloudfront.net, while DNS record cf.example.com is still pointing to d123.cloudfront.net.
It would still work as:
- The client resolves
cf.example.com(as if resolvingd123.cloudfront.net) and connects to the CloudFront PoP. - The client sends an HTTP request with
Host: cf.example.comhost header. - With this
Hostheader, CloudFront learns that this request belongs to the production distribution, where alternate domain name is configured.
I would still recommend to modify DNS record cf.example.com to point to the correct distribution, for example, to avoid the situation that staging distribution gets disabled. I would also recommend taking a look at this doc to move alternate domain names between distributions without any downtime.
Lastly, the most relevant document would be this one while there are many great re:invent presentations explaining with more details, such as the very beginning of this talk that briefly explains HTTP request lifecycle.
Relevant content
- asked 2 years ago
- asked 2 years ago
