++ add Gestione dietro reverse proxy

This commit is contained in:
2026-04-13 12:30:33 +00:00
parent 5e98423e7a
commit 465e7cf092
8 changed files with 20 additions and 33 deletions

View File

@@ -5,6 +5,7 @@ namespace App\Providers;
use Illuminate\Support\ServiceProvider;
use Illuminate\Support\Facades\Gate;
use Illuminate\Support\Facades\Artisan;
use Illuminate\Support\Facades\URL;
class AppServiceProvider extends ServiceProvider
{
@@ -15,6 +16,11 @@ class AppServiceProvider extends ServiceProvider
public function boot(): void
{
// Force HTTPS when behind a reverse proxy
if (str_starts_with(config('app.url'), 'https://')) {
URL::forceScheme('https');
}
// Auto-generate APP_KEY if missing
if (empty(config('app.key'))) {
Artisan::call('key:generate', ['--force' => true]);