diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php index 11baa730b..4ccc78641 100644 --- a/app/Providers/AppServiceProvider.php +++ b/app/Providers/AppServiceProvider.php @@ -4,9 +4,11 @@ namespace Pterodactyl\Providers; use View; use Cache; +use Illuminate\Support\Str; use Pterodactyl\Models\User; use Pterodactyl\Models\Server; use Pterodactyl\Models\Subuser; +use Illuminate\Support\Facades\URL; use Illuminate\Pagination\Paginator; use Illuminate\Support\Facades\Schema; use Illuminate\Support\ServiceProvider; @@ -32,6 +34,15 @@ class AppServiceProvider extends ServiceProvider View::share('appIsGit', $this->versionData()['is_git'] ?? false); Paginator::useBootstrap(); + + // If the APP_URL value is set with https:// make sure we force it here. Theoretically + // this should just work with the proxy logic, but there are a lot of cases where it + // doesn't, and it triggers a lot of support requests, so lets just head it off here. + // + // @see https://github.com/pterodactyl/panel/issues/3623 + if (Str::startsWith(config('app.url') ?? '', 'https://')) { + URL::forceScheme('https'); + } } /**