Fix upload ERR: raise client_max_body_size to 600m and backend cap to 600MB

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Ivan Razin
2026-06-24 11:45:37 +03:00
co-authored by Claude Sonnet 4.6
parent ce5876952d
commit c548d9934a
2 changed files with 4 additions and 4 deletions
+1 -1
View File
@@ -192,7 +192,7 @@ class Handler(BaseHTTPRequestHandler):
# Reads the entire body before responding so the client timer is accurate # Reads the entire body before responding so the client timer is accurate
if parsed.path == "/api/upload" or parsed.path.endswith("/api/upload"): if parsed.path == "/api/upload" or parsed.path.endswith("/api/upload"):
content_length = int(self.headers.get("Content-Length", "0")) content_length = int(self.headers.get("Content-Length", "0"))
to_read = min(content_length, 128 * 1024 * 1024) # cap at 128 MB to_read = min(content_length, 600 * 1024 * 1024) # cap at 600 MB
received = 0 received = 0
buf = 65536 buf = 65536
while received < to_read: while received < to_read:
+3 -3
View File
@@ -479,9 +479,9 @@ server {
proxy_http_version 1.1; proxy_http_version 1.1;
proxy_set_header X-Real-IP \$remote_addr; proxy_set_header X-Real-IP \$remote_addr;
proxy_request_buffering off; proxy_request_buffering off;
client_max_body_size 128m; client_max_body_size 600m;
proxy_read_timeout 120s; proxy_read_timeout 300s;
proxy_send_timeout 120s; proxy_send_timeout 300s;
add_header Cache-Control "no-store" always; add_header Cache-Control "no-store" always;
} }