Server: move services to subdomains
This commit is contained in:
parent
5a52fd9f3a
commit
1a84aa2290
3 changed files with 17 additions and 22 deletions
|
|
@ -34,26 +34,22 @@
|
|||
AmbientCapabilities = "CAP_CHOWN CAP_FOWNER";
|
||||
};
|
||||
|
||||
# Add a cname for syncthing
|
||||
services.dnsmasq.settings.cname = [ "sync.everest.sable-pancake.ts.net,everest" ];
|
||||
|
||||
# Set up traefik as the reverse proxy for syncthing
|
||||
services.traefik = {
|
||||
dynamicConfigOptions = {
|
||||
http = {
|
||||
routers = {
|
||||
syncthing-subpath = {
|
||||
middlewares = [ "syncthing-add-trailing-slash" "syncthing-strip-prefix" ];
|
||||
rule = "PathPrefix(`/syncthing`)";
|
||||
syncthing-subdomain = {
|
||||
rule = "Host(`sync.everest.sable-pancake.ts.net`)";
|
||||
service = "syncthing";
|
||||
};
|
||||
};
|
||||
services.syncthing.loadBalancer.servers = [
|
||||
{ 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/";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue