amazon-cloudfront - CloudFront - 如何将所有请求 header 转发到源

标签 amazon-cloudfront

在 CloudFront 行为设置中,“全部”是将所有请求 header 转发到源吗?

enter image description here

  • Values That You Specify When You Create or Update a Distribution

  • If you configure CloudFront to forward all headers to your origin for a cache behavior, CloudFront never caches the associated objects. Instead, CloudFront forwards all requests for those objects to the origin. In that configuration, the value of Minimum TTL must be 0.

    最佳答案

    是的。

    该文档似乎更多地关注基于 header 的缓存而不是转发的内容,但是缓存 header 和将 header 转发到源头是相辅相成的。

    当我从文档中寻找明确的引文时,我在 Amazon CloudFront 开发人员指南中找到的一个引用如下所示。它是标题为“基于选定请求 header 的缓存”部分的链接,但其 anchor 标记是 DownloadDistValuesForwardHeaders。

    https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/distribution-web-values-specify.html#DownloadDistValuesForwardHeaders

    这表明有人试图澄清或简化文档......显然成功有限。

    请注意,这会将几乎所有 header 转发到原点,除了一些仍然是 stripped出于安全和/或操作原因,例如 X-Forwarded-Proto , X-Real-IP , 和 X-Edge-* .

    另请注意,如果您的源协议(protocol)是 HTTPS 并且您尚未将 Host 列入白名单CloudFront 中的 header ,然后将所有 header 列入白名单可能会更改源的 TLS 证书的要求。未能正确处理此问题是 CloudFront 可能返回 502 error 的几个原因之一。给观众。

    关于amazon-cloudfront - CloudFront - 如何将所有请求 header 转发到源,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59997086/

    相关文章:

    amazon-web-services - 什么是 Cloudfront 最小 TTL?

    amazon-web-services - AWS CloudFront 和 S3 : How to make new S3 content immediately available in CloudFront?

    json - 如何在基于字段值替换项目的同时在 jq 中输出整个文档?

    amazon-web-services - AWS 示例模板 : S3_Website_With_CloudFront_Distribution. 模板在启动执行 Route 53 域名时失败

    amazon-web-services - 如何设置 CloudFront 分配描述?

    ios - AWS SDK - 实现用于 CloudFront 下载的网络队列

    amazon-web-services - 如何在同一域中同时使用 AWS CloudFront 和 API Gateway?

    reactjs - Webpack 编译文件到 S3 或 CDN 服务器

    amazon-web-services - 访问被拒绝的签名 Cookie AWS

    amazon-s3 - Amazon S3 无法通过 Cloudfront 上传文件