From 0cadc25435070ef6343e350ddffe1db8b74d0a26 Mon Sep 17 00:00:00 2001 From: Josep Date: Mon, 27 Jul 2026 18:56:29 +0200 Subject: [PATCH] fix headers --- bootstrap/app.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/bootstrap/app.php b/bootstrap/app.php index b068688..e8e32d7 100644 --- a/bootstrap/app.php +++ b/bootstrap/app.php @@ -15,6 +15,17 @@ return Application::configure(basePath: dirname(__DIR__)) ) ->withMiddleware(function (Middleware $middleware): void { $middleware->web(append: [SetLocale::class]); + + // Detrás de Traefik/nginx (Dokploy): la IP del proxy inmediato (el + // contenedor nginx) es dinámica, así que confiamos en cualquier origen + // para que Laravel respete X-Forwarded-Proto y genere URLs/assets https. + $middleware->trustProxies( + at: '*', + headers: Request::HEADER_X_FORWARDED_FOR | + Request::HEADER_X_FORWARDED_HOST | + Request::HEADER_X_FORWARDED_PORT | + Request::HEADER_X_FORWARDED_PROTO, + ); }) ->withExceptions(function (Exceptions $exceptions): void { $exceptions->shouldRenderJsonWhen(