Skip to content

Static assets in Laravel not working with Serverless-lift #1159

Answered by t-richard
mikevang asked this question in Support
Discussion options

You must be logged in to vote

Hi

I think you should make sure your TrustProxies middleware is configured with Request::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-proxies

The important part here is the HEADER_X_FORWARDED_HOST, it makes sure laravel will use the value in the x-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 🙂

Replies: 1 comment 7 replies

Comment options

You must be logged in to vote
7 replies
@mikevang
Comment options

@t-richard
Comment options

@mnapoli
Comment options

@cirolosapio
Comment options

@cirolosapio
Comment options

Answer selected by mikevang
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
4 participants