简体   繁体   中英

CloudFront headers are not forwarded correctly

We have a cloudfront configuration for our new application, which is using Referer header. Initially it was not configured to Forward the headers. Then we updated the CloudFront configuration to forward the header.

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

But the problem is that the header is forwarded only from some clients. Is there a chance that CloudFront didn't update the settings for every user or might be using a cache. 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.

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.

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

The real issue was not enabling Stickie Sessions .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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