diff --git a/src/proxy/middleware/response/handle-streamed-response.ts b/src/proxy/middleware/response/handle-streamed-response.ts index 290b5d9..a9431ca 100644 --- a/src/proxy/middleware/response/handle-streamed-response.ts +++ b/src/proxy/middleware/response/handle-streamed-response.ts @@ -48,6 +48,7 @@ export const handleStreamedResponse: RawResponseBodyHandler = async ( res.setHeader("Content-Type", "text/event-stream"); res.setHeader("Cache-Control", "no-cache"); res.setHeader("Connection", "keep-alive"); + res.setHeader("X-Accel-Buffering", "no"); copyHeaders(proxyRes, res); res.flushHeaders(); } diff --git a/src/proxy/queue.ts b/src/proxy/queue.ts index 86104c0..6bd288f 100644 --- a/src/proxy/queue.ts +++ b/src/proxy/queue.ts @@ -299,6 +299,7 @@ function initStreaming(req: Request) { res.setHeader("Content-Type", "text/event-stream"); res.setHeader("Cache-Control", "no-cache"); res.setHeader("Connection", "keep-alive"); + res.setHeader("X-Accel-Buffering", "no"); // nginx-specific fix res.flushHeaders(); res.write("\n"); res.write(": joining queue\n\n");