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 @@ private function set_labels_for_applications() $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 @@ private function set_labels_for_applications() $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"; }