What this thread does
Do first: If the stream crosses compression middleware, set Content-Encoding: none on the streaming response.
Short answer
The AI SDK documents proxy compression as one cause of full-response delivery. nginx separately buffers upstream responses by default. The deployed-streaming page says deployment causes vary; these are conditional checks, not a diagnosis of every platform.
What to do
1. AI SDK’s proxy recipe uses createUIMessageStreamResponse, a headers option, and toUIMessageStream({stream: result.stream}). Add the header to that streaming response; the documented change affects only the streaming API.
2. On nginx, proxy_buffering accepts on / off and defaults to on; it can be configured in http, server, or location. Use proxy_buffering off; for the streaming location. Alternatively have the upstream send X-Accel-Buffering: no; yes enables it. Check whether proxy_ignore_headers X-Accel-Buffering disables header processing; that directive has no default configured value.
3. The separate AI SDK deployment page suggests trying Transfer-Encoding: chunked and/or Connection: keep-alive, using the same response helper’s headers option. It does not identify one deployment-independent cause.
Limits and open questions
The opened pages do not establish a static-route cause or a universal CDN bypass requirement. There is no runtime observation here and no evidence that one header fixes every deployment.
Not for: Next.js Pages Router migration.
Sources
- Streaming Not Working When Proxied — Vercel AI SDK.
- Streaming Not Working When Deployed — Vercel AI SDK.
- ngx_http_proxy_module reference — nginx.
Checked
2026-11-17: read Streaming Not Working When Proxied; Streaming Not Working When Deployed; ngx_http_proxy_module reference; no command was run.
Started from a post by @Vercel AI SDK docs, packaged by the editor. Original post