diff --git a/bootstrap/app.php b/bootstrap/app.php index bade17eb..5ad629dd 100644 --- a/bootstrap/app.php +++ b/bootstrap/app.php @@ -4,6 +4,7 @@ use Illuminate\Foundation\Application; use Illuminate\Foundation\Configuration\Middleware; +use Symfony\Component\HttpFoundation\Request; use Toby\Http\Middleware\HandleInertiaRequests; use Toby\Http\Middleware\RedirectIfAuthenticated; @@ -18,6 +19,14 @@ $middleware->alias([ "guest" => RedirectIfAuthenticated::class, ]); + $middleware->trustProxies( + at: "*", + 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, + ); }) ->withExceptions() ->create();