Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AWS Cloudfront does not forward Accept-Language header

I've created a Cloudfront distribution to deliver a couple of pages that may change according to the user language. Both pages are being served from an EC2 instance with an ELB in front of them.

My Cloudfront origin is the ELB and it works as expected regarding its cache default behavior. Although, I need to cache pages according to the user's Accept-Language header. For that, I created a custom header whitelist, where I included the Accept-Language header...but it does not work at all.

I've tried multiple configurations with no success. If I request the page directly through the ELB address it works as expected, but every time I use the CDN address the Accept-Language header gets removed in between. Any idea of what is going on here?

like image 448
fabiomartins87 Avatar asked Nov 19 '25 00:11

fabiomartins87


1 Answers

Cloudfront removes that header If You Don't Configure CloudFront to Cache Based on Header Values

How to configure cloudfront to cache based on Header Values

like image 93
strongjz Avatar answered Nov 21 '25 20:11

strongjz



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!