From 6e6dd96beaa50f839de1a3f7be590b3b7cfdfacb Mon Sep 17 00:00:00 2001 From: Aaron van Meerten Date: Mon, 22 Jan 2024 08:07:57 -0600 Subject: [PATCH] web: nginx config for load-test client if present (#1715) --- docker-compose.yml | 1 + web/rootfs/defaults/meet.conf | 30 ++++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+) diff --git a/docker-compose.yml b/docker-compose.yml index f299153..9cefe8b 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -80,6 +80,7 @@ services: - ENABLE_LIVESTREAMING_HELP_LINK - ENABLE_LIVESTREAMING_TERMS_LINK - ENABLE_LIVESTREAMING_VALIDATOR_REGEXP_STRING + - ENABLE_LOAD_TEST_CLIENT - ENABLE_LOCAL_RECORDING_NOTIFY_ALL_PARTICIPANT - ENABLE_LOCAL_RECORDING_SELF_START - ENABLE_RECORDING diff --git a/web/rootfs/defaults/meet.conf b/web/rootfs/defaults/meet.conf index 013a15b..6ec7c03 100644 --- a/web/rootfs/defaults/meet.conf +++ b/web/rootfs/defaults/meet.conf @@ -2,6 +2,7 @@ {{ $COLIBRI_WEBSOCKET_PORT := .Env.COLIBRI_WEBSOCKET_PORT | default "9090" }} {{ $COLIBRI_WEBSOCKET_REGEX := .Env.COLIBRI_WEBSOCKET_REGEX | default "jvb" }} {{ $ENABLE_JAAS_COMPONENTS := .Env.ENABLE_JAAS_COMPONENTS | default "0" | toBool }} +{{ $ENABLE_LOAD_TEST_CLIENT := .Env.ENABLE_LOAD_TEST_CLIENT | default "0" | toBool }} {{ $ENABLE_OCTO := .Env.ENABLE_OCTO | default "0" | toBool -}} {{ $ENABLE_XMPP_WEBSOCKET := .Env.ENABLE_XMPP_WEBSOCKET | default "1" | toBool }} {{ $ENABLE_SUBDOMAINS := .Env.ENABLE_SUBDOMAINS | default "true" | toBool -}} @@ -185,6 +186,35 @@ location @root_path { } {{ end }} + {{- if $ENABLE_LOAD_TEST_CLIENT }} + # load test minimal client, uncomment when used + location ~ ^/_load-test/([^/?&:'"]+)$ { + rewrite ^/_load-test/(.*)$ /load-test/index.html break; + } + location ~ ^/_load-test/libs/(.*)$ { + add_header 'Access-Control-Allow-Origin' '*'; + alias /usr/share/jitsi-meet/load-test/libs/$1; + } + + # load-test for subdomains + location ~ ^/([^/?&:'"]+)/_load-test/([^/?&:'"]+)$ { + set $subdomain "$1."; + set $subdir "$1/"; + set $prefix "$1"; + + rewrite ^/(.*)$ /load-test/index.html break; + } + + # load-test for subdomains + location ~ ^/([^/?&:'"]+)/_load-test/libs/(.*)$ { + set $subdomain "$1."; + set $subdir "$1/"; + set $prefix "$1"; + + alias /usr/share/jitsi-meet/load-test/libs/$2; + } + + {{- end }} # Anything that didn't match above, and isn't a real file, assume it's a room name and redirect to / location ~ ^/([^/?&:'"]+)/(.*)$ { set $subdomain "$1.";