Nginx and Videobridge (Colibri WS)

I found that in Nginx there is this line:

    location ~ ^/colibri-ws/default-id/(.*) {
        proxy_pass http://127.0.0.1:9090/colibri-ws/default-id/$1$is_args$args;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        tcp_nodelay on;
    }

And in videobridge configuration, there is:

    http-servers {
        public {
            port = 9090
        }
    }

May I know what are those for? If I am going to setup another videobridge instance in the same machine, will I have to duplicate them and change the port?

How are you planning on hosting the two bridges? Are you using containers?

@Freddie
I managed to run 2 instance of videobridge without container. However, I have to change the port of the second instance to make it work. So I am wondering what are those for? (This may not be the plan of how I am going to host it, just that I am trying to understand more about the system tho)

You would have to designate a different port number in sip-communicator.properties. The default is 10000, so you would need to designate the 2nd JVB as maybe 10001 or some other port number using the following:

org.jitsi.videobridge.SINGLE_PORT_HARVESTER_PORT=10001

Thank you @Freddie. But that’s a different thing with the 9090 default port. My question is what is the purpose of that Colibri WS, without it what will happen. :thinking:

Nginx proxies requests to the bridge through port 9090. You need the port accessible for colibri websockets to work.

@Freddie
So it means, if I have multiple videobridge, let’s say 5, then I will have to set 5 of this with different ports in nginx?:

    location ~ ^/colibri-ws/default-id/(.*) {
        proxy_pass http://127.0.0.1:9090/colibri-ws/default-id/$1$is_args$args;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        tcp_nodelay on;
    }

Is it the same if I use container? I couldn’t find a comprehensive tutorial of how to deploy multiple videobridge tho, do you have any reference?