Multisite installation ... in subdirectories?

Hello!

I’m setting up Discourse in an environment where I need several distinct forums, and where the set of forums needs to be flexible to change over time. (Yes, I do need multiple forums; they serve distinct communities.)

The answer seems to be a multi-site installation, and I’ve made that work: I currently have a working configuration for multi-site, with split data and web containers, per Multisite configuration with Docker. (I have two hostnames, $hostname.$domain and discourse.$domain, which has worked in my testing so far.)

However, there’s a catch: I don’t have easy DNS control, so I cannot readily add multiple “real” hostnames. All the documentation I’ve thus far seen suggests I require this for multi-site, and a quick dig through the mechanism by which multi-site support is implemented suggests this is the case.

My ideal layout would be to have each forum sit within its own subdirectory; so discourse.$domain/forum1, …, discourse.$domain/forumN; and equally ideally, being able to serve those fora from the one web container, as existing multisite mechanisms do.

Empirically, I can successfully lift the “primary” forum into a subdirectory, moving it to discourse.$domain/forum, according to Subfolder support with Docker — but this seems to tie the web container to exactly that subdirectory and, in my experiments, badly upsets multi-site.

I’ve also tried shenanigans like massaging the Host: header going into the web container, based on the path at the host’s frontend web server, to no avail — I get a weird blend of multiple forums.

So: is there a neat way to do this? Can I get away with only one web container, a la multisite? Or will I have to wear a second web container? Will that behave badly given those containers would both be pointed at the same data container with no knowledge of the other? Or am I completely up the tree?

1 Like

At the moment we don’t have support for multisite and subfolder at the same time. It is something we may pursue if a customer wants in the future, and that we estimate to be on the big side of efforts.

5 Likes

If they’re all for the same base domain, my workaround would be to have *.forum.example.com. That way a single DNS entry would be all you needed.

3 Likes

Thanks, both! I don’t think I can stand up a star-subdomain now, unfortunately, so I think I’ll have to go with no multi-site and multiple web-frontend containers. (If I’d realised this before, I would have pushed to get a star-subdomain.)

I’d certainly love to see multi-site/subfolder support — in the (unlikely) event that I wind up with some time, I might have a look into it.

1 Like