Add Nginx header to not buffer SSE connection

This should allow the Activity Panel, that uses a Server-Side Events/ Event Source connection, to work with default Nginx reverse proxy configuration.
This commit is contained in:
Deluan 2021-04-20 10:16:20 -04:00
parent f63a912341
commit abaecf2b88
1 changed files with 2 additions and 0 deletions

View File

@ -120,6 +120,8 @@ func (b *broker) ServeHTTP(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Cache-Control", "no-cache, no-transform")
w.Header().Set("Connection", "keep-alive")
w.Header().Set("Access-Control-Allow-Origin", "*")
// Tells Nginx to not buffer this response. See https://stackoverflow.com/a/33414096
w.Header().Set("X-Accel-Buffering", "no")
// Each connection registers its own message channel with the Broker's connections registry
c := b.subscribe(r)