Any way to force room names to begin with a pattern?


Is there a way to force room names to begin with a pattern ?
Like “external_” for example ?

I tried to force it using nginx configuration but it seems hard/impossible.


it could be worth it to check out the mod_muc_restrict_rooms prosody module.

1 Like

This is a good idea, I tried but had no luck with it :confused:

edit: I was able to do what I want by modifying the module to negate the pattern (if not).
There is probably a way to do it properly within the pattern but I wasn’t able to code it (first time I’m editing lua).

I was a bit disappointed to read this and I checked it, in fact Lua has only a restricted regular expression functionality and there is no way to do what you want with the module code as it is. Sigh.

Hello @ThomasMartin,

Change the location @root_path block as the following

location @root_path {
    rewrite ^/(external-.*)$ / break;
    rewrite ^/(.*)$ https://$host/external-$1;
1 Like

OK, thanks for confirming.

Hello @emrah,

Thanks for this idea/trick !
I don’t want to redirect automatically so I’m using the first rewrite only and it work pretty good.