From c978a3f4a7b7c07b8568eb0c8241d60e1ae5b540 Mon Sep 17 00:00:00 2001 From: Slavi Pantaleev Date: Fri, 24 Apr 2026 09:09:34 +0300 Subject: [PATCH] Clean up Matrix RTC reverse-proxy docs and nginx example - Move the reverse-proxy note in matrix-rtc.md out from under "Adjusting firewall rules" (not a firewall topic) into its own top-level section. - Rewrite the text to explain what actually needs to happen (WebSocket forwarding at `/livekit-server/`) and link to the nginx example. - Cross-link from the nginx example back to the docs section. - Fix trailing whitespace and an extra blank line in matrix.conf. Co-Authored-By: Claude Opus 4.7 (1M context) --- docs/configuring-playbook-matrix-rtc.md | 6 ++++-- examples/reverse-proxies/nginx/matrix.conf | 6 +++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/docs/configuring-playbook-matrix-rtc.md b/docs/configuring-playbook-matrix-rtc.md index 692d679f2..fa9c29ee0 100644 --- a/docs/configuring-playbook-matrix-rtc.md +++ b/docs/configuring-playbook-matrix-rtc.md @@ -38,9 +38,11 @@ matrix_rtc_enabled: true In addition to the HTTP/HTTPS ports (which you've already exposed as per the [prerequisites](prerequisites.md) document), you'll also need to open ports required by [LiveKit Server](configuring-playbook-livekit-server.md) as described in its own [Adjusting firewall rules](configuring-playbook-livekit-server.md#adjusting-firewall-rules) section. -### Behind a reverse proxy -If you are behind an additional reverse proxy like nginx it needs to forward websockets for livekit. +## Fronting the integrated reverse-proxy with another reverse-proxy +If you're [fronting the integrated reverse-proxy webserver with another reverse-proxy](configuring-playbook-own-webserver.md#fronting-the-integrated-reverse-proxy-webserver-with-another-reverse-proxy) (e.g. nginx), it needs to forward WebSocket traffic for [LiveKit Server](configuring-playbook-livekit-server.md) at the `/livekit-server/` path. Without that, Matrix RTC calls will not work. + +See [`examples/reverse-proxies/nginx/matrix.conf`](../examples/reverse-proxies/nginx/matrix.conf) for an nginx example. ## Installing diff --git a/examples/reverse-proxies/nginx/matrix.conf b/examples/reverse-proxies/nginx/matrix.conf index 09f2c0fef..c502100c8 100644 --- a/examples/reverse-proxies/nginx/matrix.conf +++ b/examples/reverse-proxies/nginx/matrix.conf @@ -21,8 +21,9 @@ server { # if you don't use those, you can remove them # if you use e.g. Etherpad on etherpad.example.com, add etherpad.example.com to the server_name list server_name example.com matrix.example.com element.example.com; - - # needed for matrix rtc + + # Required for Matrix RTC (WebSocket proxying to LiveKit Server). + # See: ../../../docs/configuring-playbook-matrix-rtc.md#fronting-the-integrated-reverse-proxy-with-another-reverse-proxy location /livekit-server/ { proxy_pass http://localhost:81/livekit-server/; proxy_http_version 1.1; @@ -42,7 +43,6 @@ server { error_log /var/log/nginx/matrix.error.log; } - location / { # note: do not add a path (even a single /) after the port in `proxy_pass`, # otherwise, nginx will canonicalise the URI and cause signature verification