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:
@@ -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(
|
||||||
|
|||||||
Reference in New Issue
Block a user