fix(docker): add Reverb WebSocket proxy to nginx

Add /app/ (Pusher protocol) and /apps/ (REST API) location blocks
with Upgrade/Connection headers so browsers can connect to the
in-container Reverb server via the same port 80/443 endpoint.
This commit is contained in:
André Dantas 2026-05-12 13:57:05 -03:00
parent 1a74dfc60e
commit ef501dd385

View file

@ -8,6 +8,31 @@ server {
charset utf-8;
client_max_body_size 1G;
# Reverb WebSocket (Pusher protocol). The browser connects to
# wss://<host>/app/<key>; the broadcaster REST API lives under /apps/.
# Both are proxied to the in-container Reverb on 127.0.0.1:8080.
location /app/ {
proxy_pass http://127.0.0.1:8080;
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_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_read_timeout 86400s;
proxy_send_timeout 86400s;
}
location /apps/ {
proxy_pass http://127.0.0.1:8080;
proxy_http_version 1.1;
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;
}
location / {
try_files $uri $uri/ /index.php?$query_string;
}