Skip to content

docs: add proxy_buffering off to Nginx example for SSL proxy compatibility#1005

Merged
dunglas merged 1 commit intodunglas:mainfrom
erseco:main
Feb 17, 2025
Merged

docs: add proxy_buffering off to Nginx example for SSL proxy compatibility#1005
dunglas merged 1 commit intodunglas:mainfrom
erseco:main

Conversation

@erseco
Copy link
Copy Markdown
Contributor

@erseco erseco commented Feb 6, 2025

This PR updates the documentation to include proxy_buffering off; in the Nginx configuration example for Mercure. This change improves compatibility when using Mercure behind an SSL-enabled Nginx proxy.

Problem

When Mercure is behind a Nginx reverse proxy with SSL, Nginx buffers responses by default. This can cause issues with long-lived SSE connections, leading to delayed message delivery and unexpected behavior for subscribers.

Solution

Disabling Nginx buffering with the following directive ensures that SSE messages are forwarded immediately to clients:

proxy_buffering off;

Changes

  • Docs: Updated the Nginx configuration example to include proxy_buffering off;
  • Notes: Added a brief explanation of why this directive is necessary when using SSL proxies.

Testing

  • Tested with Mercure behind an Nginx SSL proxy.
  • Observed that after adding proxy_buffering off;, SSE messages are delivered in real-time without delays.

Related issues

#854 #843 #857 #986

@dunglas dunglas merged commit 53f2d85 into dunglas:main Feb 17, 2025
8 checks passed
@dunglas
Copy link
Copy Markdown
Owner

dunglas commented Feb 17, 2025

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants