gpt4 book ai didi

amazon-web-services - 使用Cloudfront时如何找到真正的主机?

转载 作者:行者123 更新时间:2023-12-04 08:08:41 25 4
gpt4 key购买 nike

在一个看起来很奇怪的选择中,Cloudfront将Host header 设置为您在转发请求时指定的原始服务器主机。

http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/RequestAndResponseBehaviorCustomOrigin.html

为什么是这样?更重要的是,当使用通配符子域时,当它们都转发到相同的源时,我如何知道请求来自哪个子域?

最佳答案

好消息cloudfront supports host header forwarding now。它在the documentation中列出的内容很深:

Host [header]: CloudFront sets the value to the domain name of the origin that is associated with the requested object.

大概,您需要做的就是确保在“默认缓存行为设置”中启用了报头转发:

关于amazon-web-services - 使用Cloudfront时如何找到真正的主机?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23197839/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com