From 86ed1f404026104ecd75e4784c44793e47e6aa22 Mon Sep 17 00:00:00 2001 From: yuyx <237899745@qq.com> Date: Tue, 25 Nov 2025 12:24:49 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7=20=E4=BC=98=E5=8C=96=E5=A4=A7?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E4=B8=8A=E4=BC=A0=E6=94=AF=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 前端改进: - 添加axios上传请求30分钟超时配置 Nginx改进: - 增加代理超时时间到30分钟(1800秒) - 添加 proxy_request_buffering off 避免大文件缓存到磁盘 - 添加 proxy_buffering off 禁用响应缓冲 - 优化 client_body_buffer_size 修复 ERR_HTTP2_PING_FAILED / Network Error 问题 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- frontend/app.js | 1 + nginx/nginx.conf | 14 ++++++++++---- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/frontend/app.js b/frontend/app.js index 6e82c8a..3c5a4a2 100644 --- a/frontend/app.js +++ b/frontend/app.js @@ -1436,6 +1436,7 @@ handleDragLeave(e) { 'Authorization': `Bearer ${this.token}`, 'Content-Type': 'multipart/form-data' }, + timeout: 30 * 60 * 1000, // 30分钟超时,支持大文件上传 onUploadProgress: (progressEvent) => { this.uploadProgress = Math.round((progressEvent.loaded * 100) / progressEvent.total); this.uploadedBytes = progressEvent.loaded; diff --git a/nginx/nginx.conf b/nginx/nginx.conf index 2fe78f7..740be5b 100644 --- a/nginx/nginx.conf +++ b/nginx/nginx.conf @@ -49,10 +49,16 @@ server { proxy_set_header Cookie $http_cookie; proxy_pass_header Set-Cookie; - # 增加超时时间支持大文件上传 - proxy_connect_timeout 300; - proxy_send_timeout 300; - proxy_read_timeout 300; + # 增加超时时间支持大文件上传(30分钟) + proxy_connect_timeout 1800; + proxy_send_timeout 1800; + proxy_read_timeout 1800; + send_timeout 1800; + + # 大文件上传缓冲优化 + proxy_request_buffering off; + proxy_buffering off; + client_body_buffer_size 128k; } # 分享链接重定向