Multiple domains under 1 install

Hi,
Can you let me know if it is relatively easy to setup using multiple domains on one server for Jitsi Meet?

1 Like

Duplicate the nginx config of the original domain, leaving everything except domain. Make just one change in the bosh location passing the original domain hardcoded.

2 Likes

Hi,

I’ve setup multiple domains by updating nginx conf and bosh in cofig.js
proxy_set_header Host meet.abc.com;

bosh: ‘//echo var command for http_post/http-bind’,

However, the http_post is not echoing the domain name correctly. It gives the following error:
strophe.js:5666 POST https://%3C%21–/ net::ERR_NAME_NOT_RESOLVED

When I update to this:
bosh: ‘//meet.abc.com/http-bind’,

Any ideas why does not work? I have ssi on in nginx and tested with a shmtl page and it work there but not in config.js

Thank you!

Console log


abc123:20 (TIME) index.html loaded: 67.0549999922514
Logger.js:154 2020-03-01T18:57:51.486Z [modules/browser/BrowserCapabilities.js] : This appears to be chrome, ver: 80.0.3987.122
LocalStatsCollector.js:22 The AudioContext was not allowed to start. It must be resumed (or created) after a user gesture on the page. https://goo.gl/7K7WLu
(anonymous) @ LocalStatsCollector.js:22
Logger.js:154 2020-03-01T18:57:51.625Z [index.web] <HTMLDocument.>: (TIME) document ready: 212.5000001396984
Logger.js:154 2020-03-01T18:57:51.650Z [modules/UI/videolayout/VideoLayout.js] <Object.changeUserAvatar>: Missed avatar update - no small video yet for undefined
o @ Logger.js:154
Logger.js:154 2020-03-01T18:57:51.893Z [JitsiMeetJS.js] <Object.getGlobalOnErrorHandler>: UnhandledError: null Script: null Line: null Column: null StackTrace: Error: Strophe: request id 1.1 error 0 happened
at Object.i.Strophe.log (strophe.util.js:89)
at Object.error (strophe.js:2083)
at e.Bosh._onRequestStateChange (strophe.js:5569)
o @ Logger.js:154
Logger.js:154 2020-03-01T18:57:51.893Z [modules/xmpp/strophe.util.js] <Object.i.Strophe.log>: Strophe: request id 1.1 error 0 happened
o @ Logger.js:154
Logger.js:154 2020-03-01T18:57:51.893Z [modules/xmpp/strophe.util.js] <Object.i.Strophe.log>: Strophe: request errored, status: 0, number of errors: 1
o @ Logger.js:154
%3C%21–/#%20echo%20var=%22http_host%22%20–%3E/%3C!–#%20echo%20var=%22subdir%22%20default=%22%22%20–%3Ehttp-bind?room=abc123:1 Failed to load resource: net::ERR_NAME_NOT_RESOLVED
Logger.js:154 2020-03-01T18:57:51.924Z [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:5569)
o @ Logger.js:154
Logger.js:154 2020-03-01T18:57:51.924Z [modules/xmpp/strophe.util.js] <Object.i.Strophe.log>: Strophe: request id 2.2 error 0 happened
o @ Logger.js:154
Logger.js:154 2020-03-01T18:57:51.924Z [modules/xmpp/strophe.util.js] <Object.i.Strophe.log>: Strophe: request errored, status: 0, number of errors: 2
o @ Logger.js:154
%3C%21–/#%20echo%20var=%22http_host%22%20–%3E/%3C!–#%20echo%20var=%22subdir%22%20default=%22%22%20–%3Ehttp-bind?room=abc123:1 Failed to load resource: net::ERR_NAME_NOT_RESOLVED
Logger.js:154 2020-03-01T18:57:52.011Z [features/invite] Using deprecated API for retrieving phone numbers
o @ Logger.js:154
Logger.js:154 2020-03-01T18:57:59.949Z [JitsiMeetJS.js] <Object.getGlobalOnErrorHandler>: UnhandledError: null Script: null Line: null Column: null StackTrace: Error: Strophe: request id 3.3 error 0 happened
at Object.i.Strophe.log (strophe.util.js:89)
at Object.error (strophe.js:2083)
at e.Bosh._onRequestStateChange (strophe.js:5569)
o @ Logger.js:154
getGlobalOnErrorHandler @ JitsiMeetJS.js:601
window.onerror @ middleware.js:100
callErrorHandler @ GlobalOnErrorHandler.js:61
i.Strophe.log @ strophe.util.js:89
error @ strophe.js:2083
_onRequestStateChange @ strophe.js:5569
XMLHttpRequest.send (async)
l @ strophe.js:5666
(anonymous) @ strophe.js:5678
Logger.js:154 2020-03-01T18:57:59.950Z [modules/xmpp/strophe.util.js] <Object.i.Strophe.log>: Strophe: request id 3.3 error 0 happened
o @ Logger.js:154
i.Strophe.log @ strophe.util.js:90
error @ strophe.js:2083
_onRequestStateChange @ strophe.js:5569
XMLHttpRequest.send (async)
l @ strophe.js:5666
(anonymous) @ strophe.js:5678
Logger.js:154 2020-03-01T18:57:59.950Z [modules/xmpp/strophe.util.js] <Object.i.Strophe.log>: Strophe: request errored, status: 0, number of errors: 3
o @ Logger.js:154
i.Strophe.log @ strophe.util.js:77
warn @ strophe.js:2073
_hitError @ strophe.js:5362
_onRequestStateChange @ strophe.js:5570
XMLHttpRequest.send (async)
l @ strophe.js:5666
(anonymous) @ strophe.js:5678
strophe.js:5666 POST https://%3C%21–/ net::ERR_NAME_NOT_RESOLVED
l @ strophe.js:5666
(anonymous) @ strophe.js:5678

1 Like

Same here using apache. I added a ServerAlias to the VirtualHost config in apache and changed the proxy settings to:

RequestHeader set Host original-url.example
ProxyPreserveHost on

in config.js I changed the bosh setting to:
bosh: ‘//<! --# echo var=“http_host” -->/<! --# echo var=“subdir” default="" -->http-bind’,
(added a space here after the ! just for the forum not to filter it)

@damencho anything else to do? I get the same wrong url: https://%3C%21–/ which is the encoded version of https://<!–/
Looks like the echo stuff doesn’t get executed properly.

Try this in Apache config

ssi_types *;

Are you sure about that? This gives:

Invalid command ‘ssi’, perhaps misspelled or defined by a module not included in the server configuration

It works in Nginx… there must be something equivalent for Apache

http://nginx.org/en/docs/http/ngx_http_ssi_module.html

Got it, first, I added a directive for the directory where config.js resides:

<Directory "/etc/jitsi/meet/">
    Options Indexes MultiViews Includes FollowSymLinks
    AddType text/javascript .js
    SSIUndefinedEcho " "
    AddOutputFilter Includes .js
    AllowOverride All
    Order allow,deny
    Allow from all
    </Directory>

This enables server-side includes for config.js which makes it possible to parse and replace the HTTP_HOST. As you can see, I tried using SSIUndefinedEcho to simulate the “Default” attribute that apache doesn’t know - to no avail. Apache doesn’t accept an empty string. Finally, I just deleted the subdir-echo-call. Is it needed?

On my machine, the environment variable that holds the current domain name is not HTTP_HOST but SERVER_NAME. So changing config js solved it:

bosh: ‘//<! --#echo var=“SERVER_NAME” -->/http-bind’,
(added the space after ! just for the forum, remove it in your config.js)

Now apache serves Jitsi meet on both domains!

2 Likes

Hi @hokascha, would you mind to share your configuration in more detail? I am having the same issue with the domain error https://%3C%21–/. I tried to follow your workaround, but did not get it to work. Which files apart from the apache config for the second domain and the config.js did you change?

I added the second domain to the default jitsi-meet apache config using ServerAlias so there’s only one config file for all domains. Here’s the almost complete config, jusst removed default SSL related stuff:

<VirtualHost *:443>
  ServerName meet.mydomain.com
  ServerAlias meet.mydomain2.com
  Options +Includes
  AddOutputFilter Includes html

  DocumentRoot "/usr/share/jitsi-meet"
  <Directory "/usr/share/jitsi-meet">
    Options Indexes MultiViews Includes FollowSymLinks
    AddOutputFilter Includes html
    AllowOverride All
    Order allow,deny
    Allow from all
  </Directory>
  <Directory "/etc/jitsi/meet/">
    Options Indexes MultiViews Includes FollowSymLinks
    AddType text/javascript .js
    SSIUndefinedEcho " "
    AddOutputFilter Includes .js
    AllowOverride All
    Order allow,deny
    Allow from all
  </Directory>
      ErrorDocument 404 /static/404.html

   Alias "/config.js" "/etc/jitsi/meet/meet.mydomain.com-config.js"
  <Location /config.js>
    Options Indexes MultiViews Includes FollowSymLinks
    AddOutputFilter Includes html
    Require all granted
  </Location>

    Alias "/external_api.js" "/usr/share/jitsi-meet/libs/external_api.min.js"
  <Location /external_api.js>
    Require all granted
  </Location>

RequestHeader set Host meet.mydomain.com
ProxyPreserveHost on
ProxyPass /http-bind http://localhost:5280/http-bind/
ProxyPassReverse /http-bind http://localhost:5280/http-bind/

</VirtualHost>

Note ProxyReverseHost and RequestHeader were added, too.

Looks like you’re problem at the moment is related to apache not executing server side includes, which results in that strange URL https://%3C%21–/. So watch out for the Options Includes and AddOutputFilter config vars. To easily check if it works, just call http://your-domain.com/config.js and see if the bosh URL is inserted as expected.

1 Like

Hi @hokascha,

thanks a lot, this helped me quite a bit!

I had to deal with errors coming from the CORS policy which required the additional headers Access-Control-Allow-Origin. But now it seems to be working. Thanks!

For me this results in a cross-origin error when trying to enter a room (“CORS header ‘Access-Control-Allow-Origin’ missing” when trying to reach https://original.domain/http-bind?room=loremipsum). Can you give me any hint what I might miss?

Edit: Adding the header ‘Access-Control-Allow-Origin’ ‘*’ inside the bosh location didn’t help.

Are you using Apache too? For me adding these headers worked:

  Header set Access-Control-Allow-Origin "https://meet.mydomain2.com"
  Header set Access-Control-Allow-Headers "Origin, X-Requested-With, Content-Type, Accept"

It seems like you know what you are doing with this!
We need someone to help us implement Video Conferencing on several sites.
Do you do this type of work?
Currently we are using the WP plugin BuddyMeet on a website and it works, but we see strangers come in and join our private conversations quite often. Sometimes it looks like someone comes in with no video or microphone on, and then they disappear. Most of our communications will be one on one but I would like to set this up so it works well and is private.
Please Reply Via Email if you are interested.
Frank Motola / frank@brandtastic1.com

I use nginx, but adding the Access-Control-Allow-Headers didn’t change the situation.

Do I still need to change the bosh: line in config.js as mentioned here? Because doing so breaks my instance completely. I’m thoroughly confused right now.

Edit: Alright, I had to add the Access-Control headers in the original server block, not in the new one. Now it’s working.

1 Like