How to redirect webfinger to subdomain

1. The problem I’m having:

Hello Caddy community, I’m trying to understand how to do something in caddy, please bear with me, I’m a beginner in every tool and technology being used and doing this as my first learning project.

I have set a to host multiple services for me and my friends, this far I have a photo album management service running on and a cloud storage service running on

Now I want to run an akkoma (a pleroma/mastodon fork) server and web client on The problem is that if I host my akkoma instance on a subdomain, my users will be If I want them to be, I need to change some configurations, one of them being in caddy. I have the following example code for nginx:

location = /.well-known/host-meta {
       return 301$request_uri;

And I’m having trouble understanding how to implement this on caddy. I’ve searched both the web in general and this forum specifically, as well as read the caddy documentation. I haven’t tried it yet but I think the correct implementation would be: {
} {
       reverse_proxy localhost:8080

2. Error messages and/or full log output:

3. Caddy version:


4. How I installed and ran Caddy:

5. Links to relevant resources:

Using paths in the site address is deprecated. You should use path matchers inside your site.

Something like this: {
	redir /.well-known/host-meta{uri} permanent

This uses the redir directive, with an inline path matcher.

Keep in mind that Caddy isn’t configured to handle anything else for with this config, you should probably serve something to the user, otherwise they’ll just get empty 200 status responses.

Hello Francis, thank you for the answer!
If I understood you correctly then I can do something like this: {
	redir /.well-known/host-meta{uri} permanent 

To both have a page served at and have akkoma working properly at Is that correct? In any case I will try to set it up as you instructed and come back to either confirm that it works or to ask for further support if it doesn’t work.

Yep. You’ll probably need the root directive as well to tell file_server where to read files from.

I had some trouble getting akkoma to work properly, and when I managed to get it working it was running on my subdomain with users registering there too. So in the end I don’t know if this would have worked or not, but I hope it is useful for someone in the future. I’m gonna favorite this post so I can check it if or when I try doing this again. Once again thanks for the help!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.