From 008f1bc36f0a3f38a75d937800b403b0c88097d0 Mon Sep 17 00:00:00 2001 From: Toast Date: Sat, 2 Sep 2023 01:33:36 +0200 Subject: [PATCH] Syncthing: tell traefik to redirect /syncthing to /syncthing/ --- roles/server/syncthing.nix | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/roles/server/syncthing.nix b/roles/server/syncthing.nix index 3378689..baddf06 100755 --- a/roles/server/syncthing.nix +++ b/roles/server/syncthing.nix @@ -23,8 +23,8 @@ http = { routers = { syncthing-subpath = { - middlewares = [ "syncthing-strip-prefix" ]; - rule = "PathPrefix(`/syncthing/`)"; + middlewares = [ "syncthing-add-trailing-slash" "syncthing-strip-prefix" ]; + rule = "PathPrefix(`/syncthing`)"; service = "syncthing"; }; }; @@ -32,6 +32,11 @@ { url = "http://localhost:8384"; } ]; middlewares.syncthing-strip-prefix.stripprefix.prefixes = "/syncthing"; + middlewares.syncthing-add-trailing-slash.redirectRegex = { + # Going to everest/syncthing without a slash at the end breaks things + regex = "http:\/\/everest\/syncthing+$"; + replacement = "http://everest/syncthing/"; + }; }; }; };