diff --git a/build/packages-template/bbb-config/after-install.sh b/build/packages-template/bbb-config/after-install.sh index c1370e276f..bb5cea48df 100644 --- a/build/packages-template/bbb-config/after-install.sh +++ b/build/packages-template/bbb-config/after-install.sh @@ -130,7 +130,7 @@ if [ -d /var/mediasoup/screenshare ]; then fi sed -i 's/worker_connections 768/worker_connections 4000/g' /etc/nginx/nginx.conf -echo 'limit_conn_zone $uri zone=ws_zone:5m;' > /etc/nginx/conf.d/html5-conn-limit.conf + if grep -q "worker_rlimit_nofile" /etc/nginx/nginx.conf; then num=$(grep worker_rlimit_nofile /etc/nginx/nginx.conf | grep -o '[0-9]*') if [[ "$num" -lt 10000 ]]; then diff --git a/build/packages-template/bbb-html5/after-install.sh b/build/packages-template/bbb-html5/after-install.sh index 2ddd6f0cbb..6005ed5a65 100644 --- a/build/packages-template/bbb-html5/after-install.sh +++ b/build/packages-template/bbb-html5/after-install.sh @@ -8,6 +8,11 @@ if [ ! -L /etc/nginx/sites-enabled/bigbluebutton ]; then ln -s /etc/nginx/sites-available/bigbluebutton /etc/nginx/sites-enabled/bigbluebutton fi +# This config file was renamed, remove from old path if exists +if [ -f /etc/nginx/conf.d/html5-conn-limit.conf ]; then + rm -r /etc/nginx/conf.d/html5-conn-limit.conf +fi + cd /usr/share/meteor # meteor code should be owned by root, config file by meteor user diff --git a/build/packages-template/bbb-html5/bbb-html5-conn-limit.conf b/build/packages-template/bbb-html5/bbb-html5-conn-limit.conf new file mode 100644 index 0000000000..b4a82e208f --- /dev/null +++ b/build/packages-template/bbb-html5/bbb-html5-conn-limit.conf @@ -0,0 +1 @@ +limit_conn_zone $uri zone=ws_zone:5m; \ No newline at end of file diff --git a/build/packages-template/bbb-html5/bbb-html5.nginx b/build/packages-template/bbb-html5/bbb-html5.nginx index 00328bb6dd..980467d2ae 100644 --- a/build/packages-template/bbb-html5/bbb-html5.nginx +++ b/build/packages-template/bbb-html5/bbb-html5.nginx @@ -4,7 +4,6 @@ location @html5client { proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "Upgrade"; - limit_conn ws_zone 3; } location /html5client/locales { @@ -45,3 +44,8 @@ location /html5client { alias /usr/share/meteor/bundle/programs/web.browser; try_files $uri @html5client; } + +location /html5client/sockjs { + try_files $uri @html5client; + limit_conn ws_zone 3; +} diff --git a/build/packages-template/bbb-html5/build.sh b/build/packages-template/bbb-html5/build.sh index 8b63e756c0..3251c52dba 100755 --- a/build/packages-template/bbb-html5/build.sh +++ b/build/packages-template/bbb-html5/build.sh @@ -26,6 +26,7 @@ cp bbb-html5.nginx staging/usr/share/bigbluebutton/nginx mkdir -p staging/etc/nginx/conf.d cp bbb-html5-loadbalancer.conf staging/etc/nginx/conf.d +cp bbb-html5-conn-limit.conf staging/etc/nginx/conf.d mkdir -p staging/etc/systemd/system