From abdaeb10c565f45b746ad1d0b6b8919e0fdd40de Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Fri, 26 May 2023 14:37:28 +0200 Subject: [PATCH] fix --- app/Jobs/ApplicationDeploymentJob.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/Jobs/ApplicationDeploymentJob.php b/app/Jobs/ApplicationDeploymentJob.php index c43dc6adc..58bfb635b 100644 --- a/app/Jobs/ApplicationDeploymentJob.php +++ b/app/Jobs/ApplicationDeploymentJob.php @@ -400,8 +400,8 @@ 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 https if ($schema === 'https') { + // Set labels for https $labels[] = "traefik.http.routers.{$https_label}.rule=Host(`{$host}`) && PathPrefix(`{$path}`)"; $labels[] = "traefik.http.routers.{$https_label}.middlewares=gzip"; if ($path !== '/') { @@ -411,6 +411,9 @@ COPY --from={$this->application->uuid}:{$this->git_commit}-build /app/{$this->ap $labels[] = "traefik.http.routers.{$https_label}.tls=true"; $labels[] = "traefik.http.routers.{$https_label}.tls.certresolver=letsencrypt"; + + // Set labels for http (redirect to https) + $labels[] = "traefik.http.routers.{$http_label}.rule=Host(`{$host}`) && PathPrefix(`{$path}`)"; if ($this->application->settings->is_force_https) { $labels[] = "traefik.http.routers.{$http_label}.middlewares=redirect-to-https"; }