-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathnginx.conf
More file actions
65 lines (58 loc) · 2.08 KB
/
Copy pathnginx.conf
File metadata and controls
65 lines (58 loc) · 2.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
server {
listen 80;
server_name _;
# Allow large audio uploads (default 1MB is too small)
client_max_body_size 500M;
root /usr/share/nginx/html;
index index.html;
# Frontend SPA — all non-API routes → index.html
location / {
try_files $uri $uri/ /index.html;
}
# SSE endpoints — must be BEFORE the generic /api/ block
# These need special proxy settings to disable buffering for streaming
location ~ ^/api/(translate|summarize|logs) {
rewrite ^/api/(.*) /$1 break;
proxy_pass http://backend:8765;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Connection '';
proxy_http_version 1.1;
chunked_transfer_encoding off;
proxy_buffering off;
proxy_cache off;
proxy_read_timeout 3600s;
}
# Audio download — may involve ffmpeg conversion, needs long timeout
location ~ ^/api/meetings/\d+/audio {
rewrite ^/api/(.*) /$1 break;
proxy_pass http://backend:8765;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_read_timeout 300s;
proxy_send_timeout 300s;
}
# Generic API proxy → Python backend
location /api/ {
rewrite ^/api/(.*) /$1 break;
proxy_pass http://backend:8765;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_read_timeout 120s;
}
# WebSocket proxy
location /ws/ {
rewrite ^/ws/(.*) /ws/$1 break;
proxy_pass http://backend:8765;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_read_timeout 3600s;
}
}