From 23e19e177af2a1459e2fc6ce67e49e2a8759b68c Mon Sep 17 00:00:00 2001 From: Yoga Pangestu Date: Mon, 9 Feb 2026 10:49:26 +0700 Subject: [PATCH] feat: add middleware trustProxies --- bootstrap/app.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/bootstrap/app.php b/bootstrap/app.php index c183276..e5b02cd 100644 --- a/bootstrap/app.php +++ b/bootstrap/app.php @@ -3,6 +3,7 @@ use Illuminate\Foundation\Application; use Illuminate\Foundation\Configuration\Exceptions; use Illuminate\Foundation\Configuration\Middleware; +use Illuminate\Http\Request; return Application::configure(basePath: dirname(__DIR__)) ->withRouting( @@ -11,7 +12,14 @@ health: '/up', ) ->withMiddleware(function (Middleware $middleware): void { - // + $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(function (Exceptions $exceptions): void { //