Jelajahi Sumber

web: nginx config for load-test client if present (#1715)

Aaron van Meerten 1 tahun lalu
induk
melakukan
6e6dd96
2 mengubah file dengan 31 tambahan dan 0 penghapusan
  1. 1 0
      docker-compose.yml
  2. 30 0
      web/rootfs/defaults/meet.conf

+ 1 - 0
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

+ 30 - 0
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.";