🔧 优化大文件上传支持

前端改进:
- 添加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 <noreply@anthropic.com>
This commit is contained in:
2025-11-25 12:24:49 +08:00
parent b188679f19
commit 86ed1f4040
2 changed files with 11 additions and 4 deletions

View File

@@ -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;

View File

@@ -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;
}
# 分享链接重定向