Spatie Livewire File Uploads 401 on server

Hello everyone! I'm using Filament 3.x and Spatie Media Library + docker compose.
On the local env everything is ok, but on the server I has 401 error while uploading files via upload-file?expires=1713776933&signature=6e883bc3f42d1117c5ceee6994d857a0f4df044c55f608a86619e2c0d97ad817

Googled it, but didn't find working solution. Any tips?
Solution
I added
if($this->app->environment('production')) {
URL::forceScheme('https');
request()->server->set('HTTPS', request()->header('X-Forwarded-Proto', 'https') == 'https' ? 'on' : 'off');
}
to AppProvider, but now I have another issue - uploaded photos don't show - they try to get url from localhost instead of my server domain
Was this page helpful?