mirror of
https://github.com/dartdavros/chatballs.git
synced 2026-10-05 09:14:58 +03:00
51 lines
1.5 KiB
Plaintext
51 lines
1.5 KiB
Plaintext
server {
|
|
listen 80;
|
|
server_name hub.localhost localhost;
|
|
|
|
location /api/ {
|
|
proxy_pass http://backend:8000;
|
|
proxy_set_header Host $host;
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
proxy_set_header X-Forwarded-Proto $scheme;
|
|
}
|
|
|
|
# WebSocket signaling звонков (SPEC-HUB-0013 §9).
|
|
location /ws/ {
|
|
proxy_pass http://backend:8000;
|
|
proxy_http_version 1.1;
|
|
proxy_set_header Host $host;
|
|
proxy_set_header Upgrade $http_upgrade;
|
|
proxy_set_header Connection "upgrade";
|
|
proxy_read_timeout 3600s;
|
|
}
|
|
|
|
# Web Chat widget loader (served from the hub domain).
|
|
location = /chat-widget.js {
|
|
proxy_pass http://backend:8000;
|
|
proxy_set_header Host $host;
|
|
}
|
|
|
|
# Web Chat panel (iframe content) — Vite base /chat/.
|
|
location /chat/ {
|
|
proxy_pass http://web-chat:5175;
|
|
proxy_set_header Host $host;
|
|
proxy_set_header Upgrade $http_upgrade;
|
|
proxy_set_header Connection "upgrade";
|
|
}
|
|
|
|
# Клиентская страница звонка /calls/<invite-token> (SPEC-HUB-0013 §7.2):
|
|
# отдаётся из web-chat app (entry call.html), token разбирает браузер.
|
|
location /calls/ {
|
|
rewrite ^ /chat/call.html break;
|
|
proxy_pass http://web-chat:5175;
|
|
proxy_set_header Host $host;
|
|
}
|
|
|
|
location / {
|
|
proxy_pass http://frontend:5173;
|
|
proxy_set_header Host $host;
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
proxy_set_header X-Forwarded-Proto $scheme;
|
|
}
|
|
}
|