Skip to content

Instantly share code, notes, and snippets.

@monochromer
Last active April 12, 2022 06:17
Show Gist options
  • Select an option

  • Save monochromer/cd7db2c0c94c7ad7b5930a3d3b19c5ef to your computer and use it in GitHub Desktop.

Select an option

Save monochromer/cd7db2c0c94c7ad7b5930a3d3b19c5ef to your computer and use it in GitHub Desktop.
NGINX Server Sent Events Proxy configuration

Headers from backend app:

Content-Type: text/event-stream;  
Connection: keep-alive;  
Cache-Control: no-cache;  
X-Accel-Buffering: no;
location / {
proxy_pass http://some-backend;
chunked_transfer_encoding off;
proxy_http_version 1.1;
proxy_set_header Connection '';
proxy_buffering off;
proxy_cache off;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment