From 992f4e2c6894a0e495f3309bb3fd11b180423fca Mon Sep 17 00:00:00 2001 From: Cassianvale Date: Mon, 10 Mar 2025 13:28:00 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20nginx=E9=80=82=E9=85=8D=E6=B5=81?= =?UTF-8?q?=E5=BC=8F=E8=BE=93=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nginx/nginx.conf | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/nginx/nginx.conf b/nginx/nginx.conf index 671cc64..0cdef04 100644 --- a/nginx/nginx.conf +++ b/nginx/nginx.conf @@ -78,6 +78,17 @@ server { proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; + + # 流式输出支持 + proxy_buffering off; # 禁用代理缓冲 + proxy_cache off; # 禁用代理缓存 + chunked_transfer_encoding on; # 启用分块传输编码 + tcp_nopush off; # 禁用TCP NOPUSH选项,确保数据立即发送 + tcp_nodelay on; # 启用TCP NODELAY选项,禁用Nagle算法 + keepalive_timeout 65; # 保持连接超时 + + # 确保不会压缩流式响应 + gzip off; # 对API响应禁用gzip压缩 } # 静态文件缓存设置