Syncthing: tell traefik to redirect /syncthing to /syncthing/

This commit is contained in:
Toast 2023-09-02 01:33:36 +02:00
parent 1b2eadecf4
commit 008f1bc36f

View file

@ -23,8 +23,8 @@
http = { http = {
routers = { routers = {
syncthing-subpath = { syncthing-subpath = {
middlewares = [ "syncthing-strip-prefix" ]; middlewares = [ "syncthing-add-trailing-slash" "syncthing-strip-prefix" ];
rule = "PathPrefix(`/syncthing/`)"; rule = "PathPrefix(`/syncthing`)";
service = "syncthing"; service = "syncthing";
}; };
}; };
@ -32,6 +32,11 @@
{ url = "http://localhost:8384"; } { url = "http://localhost:8384"; }
]; ];
middlewares.syncthing-strip-prefix.stripprefix.prefixes = "/syncthing"; 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/";
};
}; };
}; };
}; };