Knowledge Base

Preserving for the future: Shell scripts, AoC, and more

Running Jitsi Meet on a virtual directory

It is possible to configure Jitsi Meet to use a subdirectory, so that you can use https://www.example.com/jitsi/ but it breaks the Jitsi mobile app. If the entire user base uses desktop-based web browsers, a virtual directory is feasible.

Select a virtual directory. I used /jitsi/.

Modify Meet server

Modify file web/Dockerfile to have a second RUN statement:

RUN printf '%s\n' '<base href="/jitsi/" />' > /usr/share/jitsi-meet/base.html && \
    sed -i -r -e '/#include virtual/{s/"\//"/;};' /usr/share/jitsi-meet/index.html

Build this image with docker build . when running from inside that web/ directory. Record the image name or id number. Modify docker-compose.yml to use this new image id for service web, e.g.:

services:
    # Frontend
    web:
        image: e16e8216e37b

Modify attribute PUBLIC_URL in file .env:

PUBLIC_URL=https://www.example.com/jitsi/

An optional step, which supports the legacy http-bind method instead of the current websocket method, is to prepare file ~/.jitsi-meet-cfg/web/config.js by extracting it from a running web instance and modifying it in the following manner.

sed -i -r -e '/bosh:/{s/\/http-bind/\/jitsi\/http-bind/;};' /config/config.js

The file will then resemble included file config.js.subdir.example.

Restart docker-compose.

cd ~/docker-jitsi-meet-stable-7287
docker-compose down
docker-compose up -d

Modify httpd server

In my public https virtual host, add the directives for this Jitsi meet instance.

<VirtualHost *:443>
   ServerName www.example.com
   ServerAlias www.ipa.internal.com www.internal.com
   DocumentRoot /var/www/external
   Include conf.d/ssl-common.cnf
   Include conf.d/ssl-443.cnf
   ProxyPreserveHost On
   # Below here is for Jitsi Meet
   <IfModule mod_proxy.c>
      <IfModule mod_proxy_wstunnel.c>
         ProxyTimeout 900
         <Location "/jitsi/xmpp-websocket">
            ProxyPass "ws://server4:8000/xmpp-websocket"
         </Location>
         <Location "/jitsi/colibri-ws/">
            ProxyPass "ws://server4:8000/colibri-ws/"
         </Location>
      </IfModule>
   </IfModule>
   Proxypass         /jitsi/     http://server4:8000/
   ProxypassReverse  /jitsi/     http://server4:8000/
</VirtualHost>

Reload httpd. The virtual directory should now work on desktop browsers.

Files involved

  • server4:/home/jitsi/docker-jitsi-meet-stable-7287/web/Dockerfile
  • server4:/home/jitsi/.jitsi-meet-cfg/web/config.js

References

Weblinks

  1. https://stackoverflow.com/questions/32295168/make-jitsi-meet-work-with-apache-on-a-sub-url

Comments