Support the ongoing development of Laravel.io →
posted 7 years ago

So, I'm upgrading to Laravel 5.6 and am running into a problem with the new Symfony settings for trusted proxies. Since the new interface doesn't expose the headers, does anyone know how I tell it to use Cloudfront-Forwarded-Proto instead of the X-Forwarded-Proto header? The only thing I've found is to add a header translation in the Apache or Nginx config files, but I really want to contain this logic within my app and not rely on that. Any thoughts?

Last updated 3 years ago.
0

If anyone else has this issue, I have released a middleware package that I am hoping will solve it. I've tested it locally but don't yet have a production-ready system to test it -actually- behind cloudfront, so if anyone does use it in a live environment before I do I'd love to get feedback. The package both pulls in the CloudFront IP's as well as rewrites the Cloudfront-Forwarded-Proto header to X-Forwarded-Proto, but only if Cloudfront-Forwarded-Proto header exists.

https://packagist.org/packages/jdavidbakr/cloudfront-proxies

Last updated 7 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

jdavidbakr jdavidbakr Joined 28 Jul 2015

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2025 Laravel.io - All rights reserved.