In what seems to be a very weird choice, Cloudfront sets the Host header to the origin server host that you specify when forwarding a request.
http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/RequestAndResponseBehaviorCustomOrigin.html
Why is this? More importantly, when using wildcard subdomains, how do I know which subdomain the request is from, when they all forward to the same origin?
CloudFront has servers located in Europe (United Kingdom, Ireland, The Netherlands, Germany, Spain), Asia (Hong Kong, Singapore, Japan, Taiwan and India), Australia, South America, Africa, and several major cities in the United States. In July 2020, the service operated from 205 edge locations on six continents.
How do I check if a site has a cdn? In order to check if AWS Cloudfront (CDN) is being used, just look for an x-cache response header. It will say have a mention of the Cloudfront (ie. Hit from Cloudfront or Miss from Cloudfront).
Uses the CloudFront domain name in URLs for your objects (for example, https://d111111abcdef8.cloudfront.net/index.html )
CloudFront doesn't support assigning a static IP address to distributions. When a user requests content from CloudFront, DNS returns 4 IP addresses of the edge location with the lowest latency.
Good news- cloudfront supports host header forwarding now. It's listed very deep in the documentation:
Host [header]: CloudFront sets the value to the domain name of the origin that is associated with the requested object.
Presumably, all you need to do is ensure header forwarding is enabled in the Default Cache Behavior Settings:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With