From 950c23aa5bf8b5cb8b0bcef48c567e13c0411494 Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Fri, 26 May 2023 14:13:24 +0200 Subject: [PATCH] fixing confs --- app/Jobs/ApplicationDeploymentJob.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/app/Jobs/ApplicationDeploymentJob.php b/app/Jobs/ApplicationDeploymentJob.php index 22880e116..c43dc6adc 100644 --- a/app/Jobs/ApplicationDeploymentJob.php +++ b/app/Jobs/ApplicationDeploymentJob.php @@ -400,14 +400,6 @@ COPY --from={$this->application->uuid}:{$this->git_commit}-build /app/{$this->ap $http_label = "{$this->application->uuid}-{$slug}-http"; $https_label = "{$this->application->uuid}-{$slug}-https"; - // Set labels for http - $labels[] = "traefik.http.routers.{$http_label}.rule=Host(`{$host}`) && PathPrefix(`{$path}`)"; - $labels[] = "traefik.http.routers.{$http_label}.middlewares=gzip"; - if ($path !== '/') { - $labels[] = "traefik.http.routers.{$http_label}.middlewares={$http_label}-stripprefix"; - $labels[] = "traefik.http.middlewares.{$http_label}-stripprefix.stripprefix.prefixes={$path}"; - } - // Set labels for https if ($schema === 'https') { $labels[] = "traefik.http.routers.{$https_label}.rule=Host(`{$host}`) && PathPrefix(`{$path}`)"; @@ -422,6 +414,14 @@ COPY --from={$this->application->uuid}:{$this->git_commit}-build /app/{$this->ap if ($this->application->settings->is_force_https) { $labels[] = "traefik.http.routers.{$http_label}.middlewares=redirect-to-https"; } + } else { + // Set labels for http + $labels[] = "traefik.http.routers.{$http_label}.rule=Host(`{$host}`) && PathPrefix(`{$path}`)"; + $labels[] = "traefik.http.routers.{$http_label}.middlewares=gzip"; + if ($path !== '/') { + $labels[] = "traefik.http.routers.{$http_label}.middlewares={$http_label}-stripprefix"; + $labels[] = "traefik.http.middlewares.{$http_label}-stripprefix.stripprefix.prefixes={$path}"; + } } } }