nixos/server/traefik.nix

28 lines
841 B
Nix
Raw Normal View History

{ ... }:
{
services.traefik = {
enable = true;
staticConfigOptions = {
api = { insecure = true; };
entryPoints = {
http = { address = ":80"; };
2023-05-15 07:51:06 +01:00
https = { address = ":443"; };
};
2023-05-15 07:51:06 +01:00
certificatesResolvers = {
default = {
acme = {
email = "evie@xenia.me.uk";
storage = "/var/lib/traefik/acme.json";
httpChallenge = { entryPoint = "http"; };
};
};
};
};
dynamicConfigOptions.http = {
routers.traefik = { rule = "Host(`traefik.xenia.me.uk`)"; service = "traefik-webinterface"; tls = { certResolver = "default"; }; };
services.traefik-webinterface.loadBalancer.servers = [{ url = "http://localhost:8080"; }];
};
};
2023-05-15 07:51:06 +01:00
networking.firewall = { enable = true; allowedTCPPorts = [ 80 443 8080 ]; };
}