FIX (root cause): trust Caddy proxies in bootstrap/app.php — Laravel saw http behind Caddy, so signed upload URLs never validated -> every Livewire upload 401 -> 'failed to upload' regardless of file size. Verified: upload returns 200 with temp path.

This commit is contained in:
2026-08-10 16:00:02 +10:00
parent d3e51b0fd1
commit 0a66d92d31

View File

@@ -12,7 +12,9 @@ return Application::configure(basePath: dirname(__DIR__))
health: '/up', health: '/up',
) )
->withMiddleware(function (Middleware $middleware): void { ->withMiddleware(function (Middleware $middleware): void {
// // Caddy terminates TLS; trust its forwarded headers so Laravel sees
// https. REQUIRED for signed URLs (Livewire uploads) to validate.
$middleware->trustProxies(at: '*');
}) })
->withExceptions(function (Exceptions $exceptions): void { ->withExceptions(function (Exceptions $exceptions): void {
$exceptions->shouldRenderJsonWhen( $exceptions->shouldRenderJsonWhen(