diff --git a/docs/calls/livekit.mdx b/docs/calls/livekit.mdx
index 507ab2f18..7a1a0d57d 100644
--- a/docs/calls/livekit.mdx
+++ b/docs/calls/livekit.mdx
@@ -167,9 +167,15 @@ livekit.example.com {
-```yaml file="../public/calls/livekit.docker-compose.with-caddy-labels.yml"
+This setup assumes all containers share the same bridge network.
+
+
+```yaml title="docker-compose.yml" fold height="200" file="../public/calls/livekit.docker-compose.with-caddy-labels.yml"
```
+
+([view raw](/calls/livekit.docker-compose.with-caddy-labels.yml))
+
@@ -185,37 +191,14 @@ traefik.http.routers.livekit-jwt.rule=Host(`livekit.example.com`) && (PathPrefix
-```ini
-server {
- server_name livekit.example.com;
+```nginx title="nginx.conf" file="../public/calls/livekit.nginx.conf"
- # for lk-jwt-service
- location ~ ^/(sfu/get|healthz|get_token) {
- proxy_pass http://127.0.0.1:8081$request_uri;
- proxy_set_header X-Forwarded-For $remote_addr;
- proxy_set_header X-Real-IP $remote_addr;
- proxy_set_header Host $http_host;
- proxy_buffering off;
- }
-
- # for LiveKit
- location / {
- proxy_pass http://127.0.0.1:7880$request_uri;
- proxy_set_header X-Forwarded-For $remote_addr;
- proxy_set_header X-Real-IP $remote_addr;
- proxy_set_header Host $http_host;
- proxy_buffering off;
-
- # WebSocket
- proxy_http_version 1.1;
- proxy_set_header Upgrade $http_upgrade;
- proxy_set_header Connection $connection_upgrade;
- }
-}
```
+([view raw](/calls/livekit.nginx.conf))
+
Note: To enable WebSockets proxying functionality, include the following snippet somewhere outside your server block:
-```
+```nginx
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
diff --git a/docs/public/calls/livekit.docker-compose.with-caddy-labels.yml b/docs/public/calls/livekit.docker-compose.with-caddy-labels.yml
index bf780b91e..59cc928d8 100644
--- a/docs/public/calls/livekit.docker-compose.with-caddy-labels.yml
+++ b/docs/public/calls/livekit.docker-compose.with-caddy-labels.yml
@@ -1,4 +1,3 @@
-# This setup assumes all containers share the same bridge network
services:
lk-jwt-service:
image: ghcr.io/element-hq/lk-jwt-service:latest
diff --git a/docs/public/calls/livekit.nginx.conf b/docs/public/calls/livekit.nginx.conf
new file mode 100644
index 000000000..90e323e05
--- /dev/null
+++ b/docs/public/calls/livekit.nginx.conf
@@ -0,0 +1,26 @@
+server {
+ server_name livekit.example.com;
+
+ # for lk-jwt-service
+ location ~ ^/(sfu/get|healthz|get_token) {
+ proxy_pass http://127.0.0.1:8081$request_uri;
+ proxy_set_header X-Forwarded-For $remote_addr;
+ proxy_set_header X-Real-IP $remote_addr;
+ proxy_set_header Host $http_host;
+ proxy_buffering off;
+ }
+
+ # for LiveKit
+ location / {
+ proxy_pass http://127.0.0.1:7880$request_uri;
+ proxy_set_header X-Forwarded-For $remote_addr;
+ proxy_set_header X-Real-IP $remote_addr;
+ proxy_set_header Host $http_host;
+ proxy_buffering off;
+
+ # WebSocket
+ proxy_http_version 1.1;
+ proxy_set_header Upgrade $http_upgrade;
+ proxy_set_header Connection $connection_upgrade;
+ }
+}
diff --git a/rspress.config.ts b/rspress.config.ts
index 10b0c58a4..a0aa60458 100644
--- a/rspress.config.ts
+++ b/rspress.config.ts
@@ -25,7 +25,8 @@ export default defineConfig({
'/advanced/delegated.docker-compose.with-caddy-labels.yml',
'/advanced/delegated.docker-compose.for-traefik.yml',
'/advanced/delegated.docker-compose.with-traefik.yml',
- '/calls/livekit.docker-compose.with-caddy-labels.yml'
+ '/calls/livekit.docker-compose.with-caddy-labels.yml',
+ '/calls/livekit.nginx.conf'
]
},
},