63240f2e52
- nginx.conf: sert l'application sur 80 et 443 sans redirection interne (l'ancien "return 301 https://\$server_name" renvoyait vers localhost, server_name étant codé à localhost). NPM gère déjà le TLS/redirect public. - bootstrap/app.php: trustProxies(at: '*') pour que Laravel lise X-Forwarded-Proto/Host et génère les bonnes URL derrière NPM. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
27 lines
972 B
PHP
27 lines
972 B
PHP
<?php
|
|
|
|
use App\Http\Middleware\ForceHttps;
|
|
use App\Http\Middleware\SecurityHeaders;
|
|
use Illuminate\Foundation\Application;
|
|
use Illuminate\Foundation\Configuration\Exceptions;
|
|
use Illuminate\Foundation\Configuration\Middleware;
|
|
|
|
return Application::configure(basePath: dirname(__DIR__))
|
|
->withRouting(
|
|
web: __DIR__.'/../routes/web.php',
|
|
commands: __DIR__.'/../routes/console.php',
|
|
health: '/up',
|
|
)
|
|
->withMiddleware(function (Middleware $middleware): void {
|
|
// L'application tourne derrière nginx-proxy-manager : on fait confiance
|
|
// au reverse proxy pour lire X-Forwarded-Proto/Host (sinon Laravel croit
|
|
// être en HTTP et génère de mauvaises URL / redirections).
|
|
$middleware->trustProxies(at: '*');
|
|
|
|
$middleware->append(ForceHttps::class);
|
|
$middleware->append(SecurityHeaders::class);
|
|
})
|
|
->withExceptions(function (Exceptions $exceptions): void {
|
|
//
|
|
})->create();
|