I have a Django 4 chat feature running through Daphne, proxied by nginx and served with gunicorn on an Ubuntu EC2 instance. Everything works until the WebSocket suddenly drops—even though the handshake completes and clients connect fine at first. Each time the line goes dead I can see error messages in the server log, so there is something concrete we can trace. What I need is a focused intervention: diagnose why the WebSocket dies, adjust any Daphne, gunicorn or nginx settings that are off, and leave me with a stable, documented configuration. Feel free to SSH into a staging clone or walk me through changes via screen-share—whatever speeds things up without downtime. Nov 10 21:50:59 ip-172-31-22-115 daphne[40648]: 127.0.0.1:35870 - - [10/Nov/2025:16:12:13] "WSCONNECT /ws/chat/clinic_chat/" - - Nov 10 21:50:59 ip-172-31-22-115 daphne[40648]: 127.0.0.1:35870 - - [10/Nov/2025:16:12:14] "WSDISCONNECT /ws/chat/clinic_chat/" - - Nov 10 21:50:59 ip-172-31-22-115 daphne[40648]: 127.0.0.1:35886 - - [10/Nov/2025:16:12:14] "WSCONNECTING /ws/chat/clinic_chat/" - - Nov 10 21:50:59 ip-172-31-22-115 daphne[40648]: 127.0.0.1:35886 - - [10/Nov/2025:16:12:14] "WSCONNECT /ws/chat/clinic_chat/" - - Nov 10 21:50:59 ip-172-31-22-115 daphne[40648]: 127.0.0.1:60382 - - [10/Nov/2025:16:45:26] "WSCONNECTING /ws/chat/clinic_chat/" - - Nov 10 21:50:59 ip-172-31-22-115 daphne[40648]: 127.0.0.1:60382 - - [10/Nov/2025:16:45:26] "WSCONNECT /ws/chat/clinic_chat/" - - Nov 10 21:50:59 ip-172-31-22-115 daphne[40648]: 127.0.0.1:60382 - - [10/Nov/2025:16:50:58] "WSDISCONNECT /ws/chat/clinic_chat/" - - Nov 10 21:50:59 ip-172-31-22-115 daphne[40648]: 127.0.0.1:34262 - - [10/Nov/2025:16:50:58] "WSCONNECTING /ws/chat/clinic_chat/" - - Nov 10 21:50:59 ip-172-31-22-115 daphne[40648]: 127.0.0.1:34262 - - [10/Nov/2025:16:50:58] "WSCONNECT /ws/chat/clinic_chat/" - - Nov 10 21:50:59 ip-172-31-22-115 daphne[40648]: 127.0.0.1:34262 - - [10/Nov/2025:16:50:59] "WSDISCONNECT /ws/chat/clinic_chat/" - - Deliverables • Root-cause explanation with the relevant log excerpt • Updated config files (nginx, systemd service, Django settings, etc.) • A short note on any limits or timeouts you tuned so I can reproduce this on future instances A smooth, uninterrupted chat stream will be the acceptance test.