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,