aux-config/modules/nixos/services/nas/traefik-proxy.nix

36 lines
908 B
Nix
Raw Normal View History

{
inputs,
config,
lib,
pkgs,
system,
...
}:
let
cfg = config.services.nas;
in
{
config = lib.mkIf (cfg.enable && cfg.useTraefik.enable) {
services.traefik = {
enable = true;
staticConfigOptions = {
entryPoints.web.address = ":80";
entryPoints.websecure.address = ":443";
2024-11-30 02:19:06 +01:00
api = {
insecure = true;
};
};
dynamicConfigOptions = {
# http.routers.dashboard.entrypoints = "websecure";
# http.routers.dashboard.tls = true;
# http.routers.dashboard.rule = "Host(`traefik.localhost`) && (PathPrefix(`/api`) || PathPrefix(`/dashboard`))";
# http.routers.dashboard.service = "api@internal";
# http.routers.dashboard.middlewares = "auth";
# http.middlewares.auth.basicauth.users = "master:\$\$2y\$\$05\$\$YWM0ZknINeHpJsNqqsd91eF/yl.S8t12TPQsDmf92glrjGW9Y1RvO";
};
};
};
}