{ ... }: # Caddy reverse proxy with automatic HTTPS (Let's Encrypt). # All app ports are bound to 127.0.0.1; only Caddy listens on 80/443. { services.caddy = { enable = true; email = "me@karanj.com"; virtualHosts = { # AdGuard Home web UI, plus the HTTP-01 webroot for the independent # ACME cert AdGuard uses for its own DoH/DoT TLS (modules/acme.nix). "dns.karanj.com" = { extraConfig = '' handle /.well-known/acme-challenge/* { root * /var/lib/acme/acme-challenge file_server } handle { reverse_proxy 127.0.0.1:3000 } ''; }; # Miniflux RSS reader "rss.karanj.com" = { extraConfig = '' reverse_proxy 127.0.0.1:8080 ''; }; # Actual Budget "budget.karanj.com" = { extraConfig = '' reverse_proxy 127.0.0.1:5006 ''; }; # cgit - public read-only git viewer + smart HTTP for git clone/pull. # Both cgit browsing and git-http-backend (clone/pull) are served by # the same nginx vhost on 8086 - nginx itself routes between them by # matching the request path, so a single proxy here covers both. "git.karanj.com" = { extraConfig = '' reverse_proxy 127.0.0.1:8086 ''; }; }; }; }