From 30909f32687c3d08036614be276e9ba765842a6a Mon Sep 17 00:00:00 2001 From: poduck Date: Mon, 8 Dec 2025 10:46:37 -0500 Subject: [PATCH] fix: Add WebSocket proxy configuration to nginx MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The nginx.conf was missing a location block for /ws/ paths, causing WebSocket connections to fall through to the SPA catch-all and return index.html instead of proxying to Django/Daphne. Added proper WebSocket proxy configuration with: - HTTP/1.1 upgrade headers for WebSocket protocol - 24-hour read timeout for long-lived connections - Standard proxy headers for Django 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- frontend/nginx.conf | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/frontend/nginx.conf b/frontend/nginx.conf index 4c61fb9..1cf3b20 100644 --- a/frontend/nginx.conf +++ b/frontend/nginx.conf @@ -63,6 +63,19 @@ http { proxy_set_header X-Forwarded-Proto $scheme; } + # Proxy WebSocket connections to Django (Daphne/ASGI) + location /ws/ { + proxy_pass http://django:5000; + 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 86400; + } + # Proxy Static/Media to Django (if served by WhiteNoise/Django) location /static/ { proxy_pass http://django:5000;