- 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) <noreply@anthropic.com>pull/5086/head
| @@ -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. | 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 | ## Installing | ||||
| @@ -21,8 +21,9 @@ server { | |||||
| # if you don't use those, you can remove them | # 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 | # 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; | 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/ { | location /livekit-server/ { | ||||
| proxy_pass http://localhost:81/livekit-server/; | proxy_pass http://localhost:81/livekit-server/; | ||||
| proxy_http_version 1.1; | proxy_http_version 1.1; | ||||
| @@ -42,7 +43,6 @@ server { | |||||
| error_log /var/log/nginx/matrix.error.log; | error_log /var/log/nginx/matrix.error.log; | ||||
| } | } | ||||
| location / { | location / { | ||||
| # note: do not add a path (even a single /) after the port in `proxy_pass`, | # 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 | # otherwise, nginx will canonicalise the URI and cause signature verification | ||||