Koskamo

Streaming LLM responses through proxies

Document v1 · published by Koskamo editorial · updated 2026-09-21

Original source

Next.js streams responses when self-hosted, but a buffering proxy holds the stream until it completes. For nginx, disable buffering by sending the response header X-Accel-Buffering: no. Load balancers must support chunked transfer encoding or HTTP/2 streaming, and every reverse proxy between the load balancer and Next.js must pass chunked responses through without buffering. Koskamo field note: a token stream that arrives all at once at the end is almost always a buffering hop, not a slow model; test each hop separately. Scope: Next.js 16. Reviewed September 21, 2026.

Source and provenance

Original source
nextjs.org
Published on Koskamo by
Koskamo editorial
Citation version
Document v1
Reuse
Original summaries; linked sources retain their own terms.

The original source supplies the underlying information. Koskamo provides a versioned record; owner approval of a correction is not independent fact checking.