404 Error from HTTP request made to Prosody Plugin

I am trying to write an API to get some information on jitsi rooms and participants. First I was trying to run and test the prosody-plugin mod_muc_size.lua. I am not able to call the APIs defined in mod_muc_size.lua as the output for the following curl command gives a 404 error.




<!DOCTYPE html>
<meta charset="utf-8">
<title>404 Not Found</title>
p+p {
<h1>404 Not Found</h1>
<p>Whatever you were looking for is not here. It&apos;s behind you.</p>
<p>Unknown host:</p>

Following is my configuration file.

VirtualHost "dev.meet.domain.com"
    -- enabled = false -- Remove this line to enable this host
    authentication = "anonymous"
    -- Properties below are modified by jitsi-meet-tokens package config
    -- and authentication above is switched to "token"
    -- Assign this host a certificate for TLS, otherwise it would use the one
    -- set in the global section (if any).
    -- Note that old-style SSL on port 5223 only supports one certificate, and will always
    -- use the global one.
    ssl = {
        key = "/etc/prosody/certs/dev.meet.domain.com.key";
        certificate = "/etc/prosody/certs/dev.meet.domain.com.crt";
    av_moderation_component = "avmoderation.dev.meet.domain.com"
    speakerstats_component = "speakerstats.dev.meet.domain.com"
    conference_duration_component = "conferenceduration.dev.meet.domain.com"
    -- we need bosh
    modules_enabled = {
        "ping"; -- Enable mod_ping
    c2s_require_encryption = false
    lobby_muc = "lobby.dev.meet.domain.com"
    breakout_rooms_muc = "breakout.dev.meet.domain.com"
    main_muc = "conference.dev.meet.domain.com"
    -- muc_lobby_whitelist = { "recorder.dev.meet.domain.com" } -- Here we can whitelist jibri to enter lobby enabled rooms

Component "conference.dev.meet.domain.com" "muc"
    restrict_room_creation = true
    storage = "memory"
    modules_enabled = {
    admins = { "focus@auth.dev.meet.domain.com" }
    muc_room_locking = false
    muc_room_default_public_jids = true

I have the mod_muc_size.lua file at /usr/share/jitsi-meet/prosody-plugins and can confirm that the plugin is loaded. (Confirmed by putting a log inside.) Also I get no errors in any of the prosody.log, prosody.err, nginx.log files.

I guess that the 5280 port works well because I have checked curl command and it works well.

	<p>It works! Now point your BOSH client to this URL to connect to Prosody.</p>
	<p>For more information see <a href="https://prosody.im/doc/setting_up_bosh">Prosody: Setting up BOSH</a>.</p>

My lua version - 5.2

How can I resolve this and in which level can these requests made to mod_muc_size.lua fail?
Thanks in advance.

You are requesting it on domain, where the module is running on dev.meet.domain.com.

Hi @damencho , Thanks for replying, I am running the curl command from the server. Not from my local machine. Means I am logged into the server running jitsi. Should the command still be different?

Doesn’t matter, I’m telling you why it doesn’t work on prosody point of view. You may add nginx proxy rule to pass correct http host header with correct domain.

Thanks for the comments @damencho . They helped me to resolve the problem. I added a rule to my nginx config on the server like this.

location = /room {
        proxy_set_header X-Forwarded-For $remote_addr;
        proxy_set_header Host dev.meet.domain.com;
        add_header Content-Type "application/json; charset=UTF-8";
        add_header 'Access-Control-Allow-Origin' '*';


I am now able to access the API from my local environment. The request is correctly being routed to the prosody service at the server level.

Make sure you protected somehow so it is not public so anyone can check rooms :slight_smile:

1 Like