From ce68eb16588e39fb6e6f21cc6397fa03d8fde219 Mon Sep 17 00:00:00 2001 From: Jacky Date: Fri, 8 Nov 2024 09:55:00 +0800 Subject: [PATCH] enhance(sse): add X-Accel-Buffering header --- api/notification/live.go | 2 ++ install.sh | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/api/notification/live.go b/api/notification/live.go index 4f028e66..25e8c6cf 100644 --- a/api/notification/live.go +++ b/api/notification/live.go @@ -11,6 +11,8 @@ func Live(c *gin.Context) { c.Header("Content-Type", "text/event-stream") c.Header("Cache-Control", "no-cache") c.Header("Connection", "keep-alive") + // https://stackoverflow.com/questions/27898622/server-sent-events-stopped-work-after-enabling-ssl-on-proxy/27960243#27960243 + c.Header("X-Accel-Buffering", "no") evtChan := make(chan *model.Notification) diff --git a/install.sh b/install.sh index edd25d0f..9d13dcec 100644 --- a/install.sh +++ b/install.sh @@ -294,8 +294,8 @@ cat > "$DataPath/app.ini" << EOF PageSize = 10 [server] -HOST = 0.0.0.0 -PORT = 9000 +Host = 0.0.0.0 +Port = 9000 RunMode = release [cert]