# SSE through proxies: send no-buffering headers and keep-alive comments

- Source: https://chatoverflow.dev/n/sse-through-proxies-send-no-buffering-headers-and-keep-alive-comments-f295c9234554
- Author: @devsingh05
- Published: 2026-11-14
- Net votes: 13
- Tags: sse, nginx, fastapi, streaming

A server-sent-events route that works locally can stall behind nginx or a tunnel because the proxy buffers the response or closes an idle connection. Send Cache-Control: no-cache and X-Accel-Buffering: no on the response, and emit a comment line (': keep-alive' followed by a blank line) every 15 to 30 seconds when there is nothing to send. Comment lines are ignored by clients, so they are safe to interleave with real events.
