Installing Jitsi-Meet twice on one server with two subdomains

I have the following Situation:
one Server Ubuntu 18.04 LTS headless with nginx and one public IP
Two domains are directed to this server, now both want to have video conferences.
I have created two subdomains: meet.xyz.com and meet.abc.com

I installed jitsi-meet on one subdomain without any problem, but now how can I have another jitsi-meet on the other subdomain?

Thanks

Just copy the nginx config of the configured domain, change just server_name, change the proxy host: https://github.com/jitsi/jitsi-meet/blob/master/doc/debian/jitsi-meet/jitsi-meet.example#L46. Let’s say you when installing the packages you use meet.abc.com
proxy_set_header Host $http_host; to be proxy_set_header Host meet.abc.com;.
Probably you will need to generate new certificates and update the nginx file for the new cert files: https://github.com/jitsi/jitsi-meet/blob/master/doc/debian/jitsi-meet/jitsi-meet.example#L18
This should make the same deployment visible under two domains.

Thanks, I made the changes.
It opens up the jitsi-meet, and it lets me create conferences, but I cannot activate the mic or video and it disconnects an reconnects again and again without mic or video, only on the second domain, the first domain is fine.
any other settings that I need to do?

What is the error you see in the console? Are you accessing it using http or https?

Where do I find the error logs? I have full root access. I am using https.

In the browser, developer tools -> javascript console.

Access to XMLHttpRequest at ‘https://meet.alinapesel.com/http-bind?room=test’ from origin ‘https://meet.dumitritalavu.com’ has been blocked by CORS policy: Response to preflight request doesn’t pass access control check: No ‘Access-Control-Allow-Origin’ header is present on the requested resource.
Logger.js:125 [JitsiMeetJS.js] <Object.getGlobalOnErrorHandler>: UnhandledError: null Script: null Line: null Column: null StackTrace: Error: Strophe: request id 2.2 error 0 happened
at Object.i.Strophe.log (strophe.util.js:89)
at Object.error (strophe.js:2083)
at e.Bosh._onRequestStateChange (strophe.js:5565)
Logger.js:125 [modules/xmpp/strophe.util.js] <Object.i.Strophe.log>: Strophe: request id 2.2 error 0 happened

Hi I have added the following lines in the main nginx domain and it works:

add_header 'Access-Control-Allow-Headers' 'Authorization,Content-Type,Accept,Origin,User-Agent,DNT,Cache-Control,X-Mx-ReqToken,Keep-Alive,X-Requested-With,If-Modified-Since';

and

add_header 'Access-Control-Allow-Origin' '*';

but is it the right way?

Your domain accessing the deployment is different from the domain configured for bosh connections: bosh: '//meet.alinapesel.com/http-bind',

Hello. I’m new here. :grinning:

I am having the same issue as @peseotni.

My goal is that I have a dev version of jitsi-meet and a demo version of jitsi-meet in one server so the demo version is not affected when I experiment/develop on jitsi. I still cannot make the “two jitsi meet in one server, different subdomains” scenario work.

I followed your solution to change the bosh connection via /etc/jitsi/meet/jitsiaa.domain.com-config.js.

    hosts: {
    // XMPP domain.
    domain: 'jitsiaa.sample.com',

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

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

    // Jirecon recording component domain.
    // jirecon: 'jirecon.jitsiaa.sample.com',

    // Call control component (Jigasi).
    // call_control: 'callcontrol.jitsiaa.sample.com',

    // Focus component domain. Defaults to focus.<domain>.
    // focus: 'focus.jitsiaa.sample.com',

    // XMPP MUC domain. FIXME: use XEP-0030 to discover it.
    muc: 'conference.jitsiaa.sample.com'
},

// BOSH URL. FIXME: use XEP-0156 to discover it.
bosh: '//jitsiaa.sample.com/http-bind',

It is resulting to this:

Thanks for your advice.

The original one I setup on the GUI via jitsi meet installation is working. For the /etc/nginx/sites-available/jitsiaa.sample.com.conf file, I just changed the subdomain name part and obtain a new cert

server {
if ($host = jitsiaa.sample.com) {
    return 301 https://$host$request_uri;
} # managed by Certbot


listen 80;
server_name jitsiaa.sample.com;
return 301 https://$host$request_uri;


}
server {
listen 443 ssl;
server_name jitsiaa.sample.com;

ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_prefer_server_ciphers on;
ssl_ciphers "SSL_CIPHERS_HERE";

add_header Strict-Transport-Security "max-age=31536000";
ssl_certificate /etc/letsencrypt/live/jitsiaa.sample.com/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/jitsiaa.sample.com/privkey.pem; # managed by Certbot

root /usr/share/jitsi-meet;
index index.html index.htm;
error_page 404 /static/404.html;

location /config.js {
    alias /etc/jitsi/meet/jitsiaa.sample.com-config.js;
}

location /external_api.js {
    alias /usr/share/jitsi-meet/libs/external_api.min.js;
}

location ~ ^/([a-zA-Z0-9=\?]+)$ {
    rewrite ^/(.*)$ / break;
}

location / {
    ssi on;
}

# BOSH
location /http-bind {
    proxy_pass      http://localhost:5280/http-bind;
    proxy_set_header X-Forwarded-For $remote_addr;
    proxy_set_header Host $http_host;
}

}

I figured it out. I had to modify the BOSH part in /etc/nginx/sites-available/jitsiaa.sample.com.conf to this:
# BOSH
location /http-bind {
proxy_pass http://localhost:5280/http-bind;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header Host jitsibb.sample.com;
}

However, I decided to just set up a different server for development purposes to not interrupt the demo site during nginx stop/restart etc. So instead of two jitsi meet instances in one server, it will be one per instance.

In which file and under which name you added this headers becuase if add these directly to nginx it saying you cannnot headers in nginx and add it to the location.and i tried to add it under nginx/sites enabled location /http-bind but even after that i am getting cors error when i call from localhost

Hi @peseotni
did you configured two subdomains in single server, please let me know how you done if you have document or configuration file share to me. I am trying this last 4 days I am able to fix the issue. The second sub domain it keep rejoining . And were you copied the above line in nginx file.
Thanks in advance.

Sorry, I gave up the idea of having two on the same server. It caused more problems, with kicking people out for no reason. I wish you good luck.

Thanks for the update, so how you are using then.

another domain, another VPS
I suppose.

thanks, but it casting for me I am using same in aws.

hi @damencho I tried your suggested method, setup server on one subdomain(sd1.mysite.com) and created one more subdomain(sd2.mysite.com) on the same server.

Copied nginx conf (sd1.mysite.com.conf to sd2.mysite.com.conf) file and a different ssl certificate, however when i created certificate got error in doing so, the error was server_names_hash_bucket_size was defined already. So commented out this line on top from (sd2.mysite.com.conf) file.

Then it started working, but i got CORS error on sd2.mysite.com .
I fixed this adding cors header mentioned @peseotni in sd1.mysite.com.conf file.

Then website started coming out nice i have changed image folder for sd2.mysite.com pointed to other folder so i can have two different layout, logo for both subdomain.

Then i got error in authentication , i thought it is subdomain authentication error from prosody tried creating new user for sd2 but prosody failed with error (sd2.mysite.com not found in config file)

My first question is .

  • Is it possible to create/add one more subdomain to same prosody config so i can have different users for different subdomains ?

After that i have created new user so it started working on sd2.mysite.com too.

then when i started recording this session jibri failed to record and recording failed.

My second question is

  • do i need to add jibri’s new user and new recorder user for new subdomain (sd2.mysite.com) in jibri config ?

Thanks

P.S. i love jitsi meet. You guys are doing a very good job. thanks for making this open source

In your second nginx config make sure for bosh you have:

proxy_set_header Host 'sd1.mysite.com';