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/"; + }; }; }; };