From 2bf169ed8874bfc39a9f0c25e2284be5bd47842e Mon Sep 17 00:00:00 2001 From: mrKamoo Date: Wed, 19 Aug 2026 17:18:05 +0200 Subject: [PATCH] =?UTF-8?q?Fait=20confiance=20aux=20reverse=20proxies=20po?= =?UTF-8?q?ur=20la=20d=C3=A9tection=20HTTPS?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sans TrustProxies, Laravel ignore X-Forwarded-Proto derrière un proxy qui termine le TLS et génère les URLs d'assets en http://, provoquant des erreurs de contenu mixte sur les pages servies en https://. Co-Authored-By: Claude Sonnet 5 --- bootstrap/app.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/bootstrap/app.php b/bootstrap/app.php index 571b676..a69e810 100644 --- a/bootstrap/app.php +++ b/bootstrap/app.php @@ -12,6 +12,12 @@ return Application::configure(basePath: dirname(__DIR__)) health: '/up', ) ->withMiddleware(function (Middleware $middleware): void { + // The app runs behind a reverse proxy that terminates TLS and forwards + // plain HTTP — without this, Laravel doesn't know the original request + // was HTTPS and generates asset/URL links as http://, which browsers + // then block as mixed content on an https:// page. + $middleware->trustProxies(at: '*'); + $middleware->alias([ 'org.ip_access' => \App\Http\Middleware\CheckOrganizationIpAccess::class, 'role' => \Spatie\Permission\Middleware\RoleMiddleware::class,