简体   繁体   English

CloudFront 标头未正确转发

[英]CloudFront headers are not forwarded correctly

We have a cloudfront configuration for our new application, which is using Referer header.我们的新应用程序有一个云端配置,它使用了Referer Initially it was not configured to Forward the headers.最初它没有配置为转发标头。 Then we updated the CloudFront configuration to forward the header.然后我们更新了 CloudFront 配置以转发 header。

ForwardedValues:
            QueryString: 'true'
            Cookies:
              Forward: 'all'
            Headers:
              - Referer

But the problem is that the header is forwarded only from some clients.但问题是 header 仅从某些客户端转发。 Is there a chance that CloudFront didn't update the settings for every user or might be using a cache. CloudFront 是否有可能没有更新每个用户的设置,或者可能正在使用缓存。 What could be done to check or resolve this issue.可以做些什么来检查或解决这个问题。

Even if you have Whitelisted the Referer header in CloudFront, cached response from CloudFront will be served without the header, you need to make cache invalidation of CloudFront in order to solve this.即使您已在 CloudFront 中将 Referer header 列入白名单,来自 CloudFront 的缓存响应将在没有 header 的情况下提供,您需要使 CloudFront 的缓存失效以解决此问题。

https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/Invalidation.html https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/Invalidation.html

Cache invalidation is the one way if that works.如果可行,缓存失效是一种方法。 if the problem still persists then you can enable the CloudFront logging to log all viewer requests for your distribution and analyze them to know the root cause.如果问题仍然存在,那么您可以启用 CloudFront 日志记录以记录您的分配的所有查看器请求并分析它们以了解根本原因。

https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/AccessLogs.html https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/AccessLogs.html

The real issue was not enabling Stickie Sessions .真正的问题是没有启用Stickie Sessions

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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