401 on file uploads after switching to HTTP for localhost

livewire.js?id=13b7c601:613
POST https://localhost/livewire/upload-file?expires=1740238903&signature=e3236db37645328d0d61db125bc3240c10943eaad32e100332ddbf1b22cbdc52 401 (Unauthorized)
livewire.js?id=13b7c601:613
POST https://localhost/livewire/upload-file?expires=1740238903&signature=e3236db37645328d0d61db125bc3240c10943eaad32e100332ddbf1b22cbdc52 401 (Unauthorized)
working properly before changing to HTTPS it is failing at livewire-tmp upload stage
//config/livewire
'temporary_file_upload' => [
'disk' => 'local',

//config/filesystems
'disks' => [
'local' => [
'driver' => 'local',
'root' => storage_path('app/private'),
//.env
FILAMENT_FILESYSTEM_DISK=local
FILESYSTEM_DISK=local

->form([
FileUpload::make('video')
->acceptedFileTypes(['video/mpeg','video/mp4'])
->multiple()
->disk('local')
->directory('videos')
->moveFiles()
])
//config/livewire
'temporary_file_upload' => [
'disk' => 'local',

//config/filesystems
'disks' => [
'local' => [
'driver' => 'local',
'root' => storage_path('app/private'),
//.env
FILAMENT_FILESYSTEM_DISK=local
FILESYSTEM_DISK=local

->form([
FileUpload::make('video')
->acceptedFileTypes(['video/mpeg','video/mp4'])
->multiple()
->disk('local')
->directory('videos')
->moveFiles()
])
5 Replies
claude
claudeOP2w ago
//abort_unless(request()->hasValidSignature(), 401)
//abort_unless(request()->hasValidSignature(), 401)
commenting out this line in FileUploadController.php and FilePreviewController.php fixes the problem, but this doesn't sound good
igorclauss
igorclauss2w ago
Have you also changed the app url in the .env?
claude
claudeOP2w ago
@igorclauss yes. this issue began when I put laravel behind a caddy proxy in local dev I've decided to avoid proxy in local dev, so the problem is gone the proxy was to test MinIO
Dennis Koch
Dennis Koch2w ago
Sounds like it's generating a bad signature. Or compares it against a domain that still uses http
toeknee
toeknee2w ago
So you need to trust the proxy, loads on gooogle about this.

Did you find this page helpful?