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 example.com to host multiple services for me and my friends, this far I have a photo album management service running on album.example.com and a cloud storage service running on cloud.example.com.
Now I want to run an akkoma (a pleroma/mastodon fork) server and web client on akkoma.example.com. The problem is that if I host my akkoma instance on a subdomain, my users will be @user@akkoma.example.com. If I want them to be @user@example.com, I need to change some configurations, one of them being in caddy. I have the following example code for nginx:
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:
This uses the redir directive, with an inline path matcher.
Keep in mind that Caddy isn’t configured to handle anything else for example.com with this config, you should probably serve something to the user, otherwise they’ll just get empty 200 status responses.
To both have a page served at example.com and have akkoma working properly at akkoma.example.com. 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.
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!