diff --git a/app/Http/Livewire/Settings/Form.php b/app/Http/Livewire/Settings/Form.php index 436090bc2..5f5e48df2 100644 --- a/app/Http/Livewire/Settings/Form.php +++ b/app/Http/Livewire/Settings/Form.php @@ -61,12 +61,15 @@ public function submit() $url = Url::fromString($this->settings->fqdn); $host = $url->getHost(); $schema = $url->getScheme(); + $middlewares = []; $entryPoints = [ 0 => 'http', ]; if ($schema === 'https') { $entryPoints[] = 'https'; + $middlewares[] = 'redirect-to-https'; } + $traefik_dynamic_conf = [ 'http' => [ @@ -77,6 +80,7 @@ public function submit() 'entryPoints' => $entryPoints, 'service' => 'coolify', 'rule' => "Host(`{$host}`)", + 'middlewares' => $middlewares, ], ], 'services' =>