nginx-sse-streaming-fix

Configure nginx and backend headers to disable buffering for SSE streaming.

2|Updated May 10, 2026
One-click install
npx skills add https://github.com/freedomw1987/tree_monstor --skill nginx-sse-streaming-fix
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: nginx-sse-streaming-fix
Source: https://github.com/freedomw1987/tree_monstor/tree/main/skills/devops/nginx-sse-streaming-fix
Command: npx skills add https://github.com/freedomw1987/tree_monstor --skill nginx-sse-streaming-fix

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill resolves the common issue where Server-Sent Events (SSE) endpoints function correctly on the backend but fail to stream data in real time to browsers when routed through an nginx reverse proxy, which buffers full responses by default and blocks incremental chunk delivery.

Core Features & Use Cases

  • Dual-side configuration fixes: Provides exact changes for both backend response headers and nginx location directives to disable buffering and enable proper streaming.
  • Troubleshooting guidance: Helps distinguish nginx-related issues from browser-side SSE parser bugs to avoid unnecessary config changes.
  • Verification steps: Includes simple checks to confirm streaming is working as expected in both curl and browser environments.
  • Use Case: Use this Skill when building real-time features like live chat, progressive image generation, or live data feeds that rely on SSE and are deployed behind nginx.

Quick Start

Use this skill to fix broken real-time SSE streaming for your nginx-reverse-proxied API endpoints by applying the provided backend and nginx configuration changes.

Frequently Asked Questions about nginx-sse-streaming-fix

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
Why does nginx break SSE streaming by buffering server-sent events responses?

Nginx reverse proxy buffers full responses by default, blocking incremental chunk delivery required for real-time SSE streaming. Disabling buffering through specific nginx location directives and backend response headers restores proper chunked transfer for streaming endpoints.

How do I disable nginx reverse proxy buffering for server-sent events?

To disable nginx SSE buffering, apply dual-side configuration fixes by setting specific backend response headers and adding nginx location directives to disable proxy buffering and enable proper chunked transfer encoding for streaming endpoints.

Does nginx proxy buffering affect long-polling and chunked transfer endpoints?

Yes, nginx reverse proxy buffering impacts all server-sent events, long-polling, and chunked transfer endpoints. The default buffering behavior blocks incremental chunk delivery, requiring configuration changes to restore real-time streaming functionality.

How can I verify that SSE streaming works correctly after fixing nginx buffering?

Verify SSE streaming works by performing simple checks in both curl and browser environments to confirm incremental chunks are forwarded in real time rather than buffered and delivered as a full response.

What's the best way to troubleshoot non-functional real-time SSE streaming behind nginx?

Troubleshoot SSE streaming by distinguishing nginx-related buffering issues from browser-side SSE parser bugs to avoid unnecessary configuration changes. Apply backend response header fixes and nginx directive adjustments to enable proper chunked transfer.

Can I use this nginx SSE buffering fix for live chat and progressive image generation endpoints?

Yes, this fix applies to real-time features like live chat, progressive image generation, and live data feeds that rely on SSE and are deployed behind nginx reverse proxies for web applications.