Configuration for Jitsi multi shard setup

I am setting up a multi shard setup of Jitsi. We will have two Jitsi meet shards (Jitsi meet web + Prosody + Jicofo + JVB) behind the HA proxy.

JMS 1 (
JMS 2 (

The primary domain will be which will forward the request to HA Proxy, and HA Proxy will deliver it to the appropriate shard.

I am having difficulty configuring the system. I cannot decide where to put or, or

In JMS1, what should be the value for the below configs?

Prosody config.
What should the virtual host and component should contain ( or

What should be the value inside the hosts part for JMS1 & JMS2

hosts: {
        // XMPP domain.
            domain: '',

        // When using authentication, domain for guest users.
            anonymousdomain: '',

        // Domain for authenticated users. Defaults to <domain>.
            // authdomain: '',

        // Focus component domain. Defaults to focus.<domain>.
            // focus: '',
        // XMPP MUC domain. FIXME: use XEP-0030 to discover it.
            muc: ''

    // BOSH URL. FIXME: use XEP-0156 to discover it.
        bosh: '//',

Similar for the JVB and JICOFO.

Those are two separate deployments accessed through two separate domains. The domains should be the same. HAProxy is for loadbalancing - meaning, moving weight between multiple shards of the same domain. So, if shard one fails, then shard2 picks up the load and vice versa. The main goal is to make sure participants destined for a meeting land on the same shard and this is done via sticky tables in HAProxy config.