Webfinger with Caddy
This is how you can add webfinger support if you’re using caddy
example.com
redir /.well-known/webfinger /webfinger/{query.resource}.json
@httpwebfinger {
path_regexp webfinger /webfinger/https?://(.+)
}
rewrite @httpwebfinger /webfinger/{re.webfinger.1}
file_server
The first line redirects to a json file at /webfinger/
So if you want to enable webfinger for user@example.com, you put the json response in the file webfinger/acct:user@example.com.json. For http adresses you need to remove the scheme: the webfinger response for https://example.com needs to be in webfinger/example.com.json.