From 7299128a349697e079c325cea17e1e394185f34d Mon Sep 17 00:00:00 2001 From: congsh Date: Sat, 18 Apr 2026 11:05:40 +0800 Subject: [PATCH] fix: resolve SSE realtime ERR_INCOMPLETE_CHUNKED_ENCODING error Add dedicated nginx location block for /api/realtime with: - proxy_buffering off to prevent response buffering - gzip off to avoid chunked encoding issues - proxy_read_timeout 86400s for long-lived SSE connections - Connection '' instead of 'upgrade' for SSE protocol Co-Authored-By: Claude Opus 4.7 --- frontend/nginx.conf | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/frontend/nginx.conf b/frontend/nginx.conf index 0f10985..d563242 100644 --- a/frontend/nginx.conf +++ b/frontend/nginx.conf @@ -15,6 +15,21 @@ server { add_header Expires "0"; } + # SSE realtime 连接(必须在 /api/ 之前) + location /api/realtime { + proxy_pass http://192.168.1.14:8090; + proxy_http_version 1.1; + proxy_set_header Connection ''; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + proxy_buffering off; + proxy_cache off; + proxy_read_timeout 86400s; + gzip off; + } + # API 代理到局域网 PocketBase location /api/ { proxy_pass http://192.168.1.14:8090;