fix middlewares name, remove httpd, add nextcloud

This commit is contained in:
♥ Minnie ♥ 2023-12-19 09:21:05 +08:00
parent 3aad8a11f9
commit 8e457614c9
4 changed files with 34 additions and 15 deletions

View file

@ -6,7 +6,7 @@
imports = [ imports = [
"${inputs.nixpkgs-unstable}/nixos/modules/services/web-servers/traefik.nix" "${inputs.nixpkgs-unstable}/nixos/modules/services/web-servers/traefik.nix"
./routers.nix ./routers.nix
./middleware.nix ./middlewares.nix
./services.nix ./services.nix
]; ];

View file

@ -42,6 +42,24 @@
# Even if an IP stays in the cache for a period of a month, it must be fetch again after a month. # Even if an IP stays in the cache for a period of a month, it must be fetch again after a month.
forceMonthlyUpdate = "true"; forceMonthlyUpdate = "true";
}; };
# Secure headers for nextcloud
nextcloud-secure-headers = {
headers = {
hostsProxyHeaders = [ "X-Forwarded-Host" ];
referrerPolicy = "same-origin";
};
};
# Redirect HTTPS
https-redirect = {
redirectscheme.scheme = "https";
};
# Nextcloud chain
nextcloud-chain = {
chain.middlewares = [
"https-redirect"
"nextcloud-secure-headers"
];
};
}; };
} }

View file

@ -2,17 +2,6 @@
{ {
services.traefik.dynamicConfigOptions.http.routers = { services.traefik.dynamicConfigOptions.http.routers = {
httpd = {
rule = "Host(`sajenim.dev`)";
entryPoints = [
"websecure"
];
middlewares = [
"geoblock"
];
service = "httpd";
};
microbin = { microbin = {
rule = "Host(`bin.kanto.dev`)"; rule = "Host(`bin.kanto.dev`)";
entryPoints = [ entryPoints = [
@ -155,6 +144,18 @@
]; ];
service = "jellyseerr"; service = "jellyseerr";
}; };
nextcloud = {
rule = "Host(`nc.kanto.dev`)";
entryPoints = [
"websecure"
];
middlewares = [
# "internal"
"nextcloud-chain"
];
service = "nextcloud";
};
}; };
} }

View file

@ -2,9 +2,6 @@
{ {
services.traefik.dynamicConfigOptions.http.services = { services.traefik.dynamicConfigOptions.http.services = {
httpd.loadBalancer.servers = [
{ url = "http://192.168.1.102:5624"; }
];
microbin.loadBalancer.servers = [ microbin.loadBalancer.servers = [
{ url = "http://192.168.1.102:8181"; } { url = "http://192.168.1.102:8181"; }
]; ];
@ -41,6 +38,9 @@
jellyseerr.loadBalancer.servers = [ jellyseerr.loadBalancer.servers = [
{ url = "http://192.168.1.102:5055"; } { url = "http://192.168.1.102:5055"; }
]; ];
nextcloud.loadBalancer.servers = [
{ url = "http://192.168.1.102:11000"; }
];
}; };
} }