This commit is contained in:
Andras Bacsai
2023-05-26 10:11:10 +02:00
parent 6192bd2cc4
commit d066b2086b

View File

@@ -61,12 +61,15 @@ class Form extends Component
$url = Url::fromString($this->settings->fqdn); $url = Url::fromString($this->settings->fqdn);
$host = $url->getHost(); $host = $url->getHost();
$schema = $url->getScheme(); $schema = $url->getScheme();
$middlewares = [];
$entryPoints = [ $entryPoints = [
0 => 'http', 0 => 'http',
]; ];
if ($schema === 'https') { if ($schema === 'https') {
$entryPoints[] = 'https'; $entryPoints[] = 'https';
$middlewares[] = 'redirect-to-https';
} }
$traefik_dynamic_conf = [ $traefik_dynamic_conf = [
'http' => 'http' =>
[ [
@@ -77,6 +80,7 @@ class Form extends Component
'entryPoints' => $entryPoints, 'entryPoints' => $entryPoints,
'service' => 'coolify', 'service' => 'coolify',
'rule' => "Host(`{$host}`)", 'rule' => "Host(`{$host}`)",
'middlewares' => $middlewares,
], ],
], ],
'services' => 'services' =>