overlocked liked a comment+100 XP
2w ago
Laravel Vite: Assets blocked/Mixed Content issues in production environment
Just in case someone lands here for Laravel 11, where the TrustProxies.php file does not exist anymore, you can achieve @hermeneus proxy fix into bootstrap/app.php :
return Application::configure(basePath: dirname(__DIR__))
// Your code…
->withMiddleware(function (Middleware $middleware) {
$middleware->trustProxies(headers: Request::HEADER_X_FORWARDED_FOR |
Request::HEADER_X_FORWARDED_HOST |
Request::HEADER_X_FORWARDED_PORT |
Request::HEADER_X_FORWARDED_PROTO |
Request::HEADER_X_FORWARDED_AWS_ELB
);
$middleware->trustProxies(at: '*');
// Rest of your code… ```