Skip to content

Commit df80902

Browse files
committed
add nginx reverse proxy sample for voice gateway
1 parent 050f620 commit df80902

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

docs/setup/server/voice.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,37 @@ You also have to configure the Voice Gateway endpoint in your database. In table
2121
"regions_available_0_endpoint": "localhost:3004"
2222
```
2323

24+
### Nginx reverse proxy for Voice Gateway
25+
26+
You will likely want to set your voice gateway behind a reverse proxy. Here's a sample Nginx configuration:
27+
28+
```nginx
29+
server {
30+
# Change server_name
31+
server_name voice.example.com;
32+
listen 80;
33+
34+
location / {
35+
# Only change this if Nginx and {{ project.name }} are not on the same machine.
36+
proxy_pass http://127.0.0.1:3004;
37+
proxy_set_header Host $host;
38+
proxy_pass_request_headers on;
39+
add_header Last-Modified $date_gmt;
40+
add_header Cache-Control 'no-store, no-cache, must-revalidate, proxy-revalidate, max-age=0';
41+
proxy_set_header X-Real-IP $remote_addr;
42+
proxy_set_header X-Forwarded-Proto https;
43+
proxy_set_header X-Forwarded-For $remote_addr;
44+
proxy_set_header X-Forwarded-Host $remote_addr;
45+
proxy_no_cache 1;
46+
proxy_cache_bypass 1;
47+
48+
# This is important. It allows Websocket connections through NGINX.
49+
proxy_set_header Upgrade $http_upgrade;
50+
proxy_set_header Connection "upgrade";
51+
}
52+
}
53+
```
54+
2455
## Configuring Voice Library
2556

2657
You can install one of the provided sample implementations or you can choose to install another third-party one. Installation process will be the same regardless:

0 commit comments

Comments
 (0)