Cloudflared

From NixOS Wiki

Cloudflared is a command line client for a network tunnel from the cloudflare network to a server.

Introduced in https://github.com/NixOS/nixpkgs/pull/171875

Example

{
  services.cloudflared = {
    enable = true;
    tunnels = {
      "00000000-0000-0000-0000-000000000000" = {
        credentialsFile = "${config.sops.secrets.cloudflared-creds.path}";
        ingress = {
          "*.domain1.com" = {
            service = "http://localhost:80";
            path = "/*.(jpg|png|css|js)";
          };
          "*.domain2.com" = "http://localhost:80";
        };
        default = "http_status:404";
      };
    };
  };
}