From 93adbdb05ade8588cd802f2e8f849fd970628d86 Mon Sep 17 00:00:00 2001 From: vincent Date: Mon, 9 May 2022 08:50:17 +0200 Subject: [PATCH] add HTTPS redirection --- homeassistant.nomad | 5 +++-- nextcloud.nomad | 4 ++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/homeassistant.nomad b/homeassistant.nomad index 1b06f10..b320f11 100644 --- a/homeassistant.nomad +++ b/homeassistant.nomad @@ -6,8 +6,8 @@ job "homeassistant" { forcedeploy = "1" } constraint { - attribute = "${attr.cpu.arch}" - value = "amd64" + attribute = "${attr.unique.hostname}" + value = "oscar" } group "homeassistant"{ @@ -38,6 +38,7 @@ job "homeassistant" { "traefik.enable=true", "traefik.http.middlewares.httpsRedirect.redirectscheme.scheme=https", "traefik.http.routers.${NOMAD_TASK_NAME}_insecure.middlewares=httpsRedirect", + "traefik.http.routers.${NOMAD_TASK_NAME}_insecure.rule=Host(`${NOMAD_TASK_NAME}.ducamps.win`)" "traefik.http.routers.${NOMAD_TASK_NAME}.rule=Host(`${NOMAD_TASK_NAME}.ducamps.win`)", "traefik.http.routers.${NOMAD_TASK_NAME}.tls.domains[0].sans=${NOMAD_TASK_NAME}.ducamps.win", "traefik.http.routers.${NOMAD_TASK_NAME}.tls.certresolver=myresolver", diff --git a/nextcloud.nomad b/nextcloud.nomad index 1158bdb..abc4def 100644 --- a/nextcloud.nomad +++ b/nextcloud.nomad @@ -33,6 +33,10 @@ job "nextcloud" { "traefik.http.routers.${NOMAD_JOB_NAME}.rule=Host(`file.ducamps.win`)", "traefik.http.routers.${NOMAD_JOB_NAME}.tls.domains[0].sans=file.ducamps.win", "traefik.http.routers.${NOMAD_JOB_NAME}.tls.certresolver=myresolver", + "traefik.http.routers.${NOMAD_JOB_NAME}_insecure.entrypoints=web", + "traefik.http.routers.${NOMAD_JOB_NAME}_insecure.rule=Host(`file.ducamps.win`)", + "traefik.http.routers.${NOMAD_JOB_NAME}_insecure.middlewares=httpsRedirect", + "traefik.http.middlewares.httpsRedirect.redirectscheme.scheme=https", ]