From 3780affc257bcb1bc0d8bc1af4daa322bba0f367 Mon Sep 17 00:00:00 2001 From: Dusan Sekulic Date: Tue, 3 Oct 2023 11:28:18 +0200 Subject: [PATCH] add traefik PathPrefix to services (#156) --- app/core/services.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/core/services.py b/app/core/services.py index 1ad4b07..a38bdb6 100644 --- a/app/core/services.py +++ b/app/core/services.py @@ -197,9 +197,13 @@ def run_container_with_retries(service_object): if dns: labels = { "traefik.enable": "true", - f"traefik.http.routers.{service_id}-http.rule": f"Host(`{service_id}.{dns}`)", + f"traefik.http.routers.{service_id}-http.rule": ( + f"PathPrefix(`/`) && Host(`{service_id}.{dns}`)" + ), f"traefik.http.routers.{service_id}-http.entrypoints": "web", - f"traefik.http.routers.{service_id}-https.rule": f"Host(`{service_id}.{dns}`)", + f"traefik.http.routers.{service_id}-https.rule": ( + f"PathPrefix(`/`) && Host(`{service_id}.{dns}`)" + ), f"traefik.http.routers.{service_id}-https.entrypoints": "websecure", f"traefik.http.routers.{service_id}-https.tls.certresolver": "myresolver", "traefik.http.middlewares.http-to-https.redirectscheme.scheme": "https",