-
I've followed the instructions for serving static assets from s3 as outlined in https://bref.sh/docs/frameworks/laravel.html#assets. In my blade file I'm trying to load an image from /public/images, and using the asset helper as described in the documentation: This works fine locally, however when I deploy to aws and load the page via cloudfront, it shows a broken image. Then looking at the served code, image is pointing to I have the following in my serverless.yml
What am I doing wrong here? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 7 replies
-
Hi I think you should make sure your The important part here is the Hope it helps. If it does, I think a PR to the docs would be welcome 🙂 |
Beta Was this translation helpful? Give feedback.
Hi
I think you should make sure your
TrustProxies
middleware is configured withRequest::HEADER_X_FORWARDED_FOR | Request::HEADER_X_FORWARDED_HOST | Request::HEADER_X_FORWARDED_PORT | Request::HEADER_X_FORWARDED_PROTO
in$headers
as showed at https://laravel.com/docs/8.x/requests#configuring-trusted-proxiesThe important part here is the
HEADER_X_FORWARDED_HOST
, it makes sure laravel will use the value in thex-forwarded-host
to generate URLs and this is automatically set by Lift's construct.Hope it helps. If it does, I think a PR to the docs would be welcome 🙂