{ "apps": { "http": { "servers": { "srv0": { "listen": [ ":443" ], "routes": [ { "match": [ { "host": [ "vault.sonr.id" ] } ], "handle": [ { "handler": "subroute", "routes": [ { "handle": [ { "handler": "headers", "response": { "replace": { "Content-Type": [ { "replace": "application/wasm", "search_regexp": ".wasm" } ] }, "set": { "Service-Worker-Allowed": [ "/" ] } } }, { "encodings": { "gzip": {}, "zstd": {} }, "handler": "encode", "prefer": [ "zstd", "gzip" ] } ] }, { "handle": [ { "handler": "subroute", "routes": [ { "handle": [ { "handler": "rewrite", "uri_substring": [ { "find": "/{http.regexp.vaultPath.0}", "replace": "/ipns/{http.regexp.vaultPath.1}{http.regexp.vaultPath.2}" } ] }, { "handler": "reverse_proxy", "upstreams": [ { "dial": "localhost:8080" } ] } ] } ] } ], "match": [ { "path_regexp": { "name": "vaultPath", "pattern": "^/([a-z0-9]{42})(/.*|)$" } } ] }, { "handle": [ { "handler": "file_server", "hide": [ "./Caddyfile" ] } ] } ] } ], "terminal": true } ] } } }, "tls": { "automation": { "policies": [ { "subjects": [ "vault.sonr.id" ], "issuers": [ { "challenges": { "dns": { "provider": { "api_token": "{env.CLOUDFLARE_API_TOKEN}", "name": "cloudflare" }, "resolvers": [ "1.1.1.1" ] } }, "email": "team@sonr.id", "module": "acme" } ] } ] } } } }