{"id":63,"date":"2021-02-05T14:06:03","date_gmt":"2021-02-05T12:06:03","guid":{"rendered":"http:\/\/www.keinzweifel.ch\/?p=63"},"modified":"2021-02-05T14:07:09","modified_gmt":"2021-02-05T12:07:09","slug":"limit-jitsi-rooms-with-nginx","status":"publish","type":"post","link":"http:\/\/www.keinzweifel.ch\/?p=63","title":{"rendered":"Limit Jitsi rooms with nginx"},"content":{"rendered":"\n<p>One of the best things about Jitsi is in my opinion also one of the worst things of it. It doesn&#8217;t need any preconfigured users and anybody can create new rooms.<\/p>\n\n\n\n<p>With a bit of tweaking the nginx config, we can define allowed room-names and deny all others. That way you as admin can quickly shuffle around the allowed rooms or just leave one permanently allowed for quickly meet your friends.<\/p>\n\n\n\n<p>Sure, this is quite a weak security measure, as anybody can enter the allowed rooms, but it is certainly better than letting anybody who knows your FQDN to create rooms as they desire.<\/p>\n\n\n\n<p>The following config-block should be within the server{} declaration.<br>We allow two rooms in this example &#8211; roomone and roomtwo.<br>You will also need to replace YOUR.FQDN with the actual path to your config.js&#8230; <\/p>\n\n\n\n<p>index index.html index.htm;<br>error_page 404 \/static\/404.html;<br><br>location = \/config.js {<br>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0alias \/etc\/jitsi\/meet\/v.nativenet.ch-config.js;<br>}<br><br>location = \/external_api.js {<br>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0alias \/usr\/share\/jitsi-meet\/libs\/external_api.min.js;<br>}<br><br>location ~ ^\/(libs|css|static|images|fonts|lang|sounds|connection_optimization|.well-known)\/(.*)$<br>{<br>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0add_header &#8216;Access-Control-Allow-Origin&#8217; &#8216;*&#8217;;<br>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0alias \/usr\/share\/jitsi-meet\/$1\/$2;<br>}<br><br># BOSH<br>location = \/http-bind {<br>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0proxy_pass \u00a0\u00a0\u00a0\u00a0\u00a0http:\/\/localhost:5280\/http-bind;<br>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0proxy_set_header X-Forwarded-For $remote_addr;<br>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0proxy_set_header Host $http_host;<br>}<br><br># xmpp websockets<br>location = \/xmpp-websocket {<br>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0proxy_pass http:\/\/127.0.0.1:5280\/xmpp-websocket?prefix=$prefix&amp;$args;<br>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0proxy_http_version 1.1;<br>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0proxy_set_header Upgrade $http_upgrade;<br>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0proxy_set_header Connection &#8220;upgrade&#8221;;<br>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0proxy_set_header Host $http_host;<br>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0tcp_nodelay on;<br>}<br><br>location ~ ^\/roomone {<br>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0try_files $uri @root_path;<br>}<br>location ~ ^\/roomtwo {<br>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0try_files $uri @root_path;<br>}<br><br>location @root_path {<br>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0rewrite ^\/(.*)$ \/ break;<br>}<br><br>location ~ ^\/([^\/?&amp;:'&#8221;]+)\/config.js$<br>{<br>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0set $subdomain &#8220;$1.&#8221;;<br>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0set $subdir &#8220;$1\/&#8221;;<br>  \u00a0\u00a0\u00a0alias \/etc\/jitsi\/meet\/YOUR.FQDN-config.js;<br>}<br>location ~ ^\/([^\/?&amp;:'&#8221;]+)\/http-bind {<br>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0set $subdomain &#8220;$1.&#8221;;<br>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0set $subdir &#8220;$1\/&#8221;;<br>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0set $prefix &#8220;$1&#8221;;<br>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0rewrite ^\/(.*)$ \/http-bind;<br>}<br><br># websockets for subdomains<br>location ~ ^\/([^\/?&amp;:'&#8221;]+)\/xmpp-websocket {<br>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0set $subdomain &#8220;$1.&#8221;;<br>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0set $subdir &#8220;$1\/&#8221;;<br>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0set $prefix &#8220;$1&#8221;;<br>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0rewrite ^\/(.*)$ \/xmpp-websocket;<br>}<br><\/p>\n","protected":false},"excerpt":{"rendered":"<p>One of the best things about Jitsi is in my opinion also one of the worst things of it. It doesn&#8217;t need any preconfigured users and anybody can create new rooms. With a bit of tweaking the nginx config, we &hellip; <a href=\"http:\/\/www.keinzweifel.ch\/?p=63\">Weiterlesen <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1,3],"tags":[],"_links":{"self":[{"href":"http:\/\/www.keinzweifel.ch\/index.php?rest_route=\/wp\/v2\/posts\/63"}],"collection":[{"href":"http:\/\/www.keinzweifel.ch\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.keinzweifel.ch\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.keinzweifel.ch\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.keinzweifel.ch\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=63"}],"version-history":[{"count":1,"href":"http:\/\/www.keinzweifel.ch\/index.php?rest_route=\/wp\/v2\/posts\/63\/revisions"}],"predecessor-version":[{"id":64,"href":"http:\/\/www.keinzweifel.ch\/index.php?rest_route=\/wp\/v2\/posts\/63\/revisions\/64"}],"wp:attachment":[{"href":"http:\/\/www.keinzweifel.ch\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=63"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.keinzweifel.ch\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=63"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.keinzweifel.ch\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=63"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}