From c548d9934aa001221bc6f37e8a75cbadaf4b9747 Mon Sep 17 00:00:00 2001 From: Ivan Razin Date: Wed, 24 Jun 2026 11:45:37 +0300 Subject: [PATCH] Fix upload ERR: raise client_max_body_size to 600m and backend cap to 600MB Co-Authored-By: Claude Sonnet 4.6 --- assets/diagnostics/mtr-backend.py | 2 +- x-ui-latest.sh | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/assets/diagnostics/mtr-backend.py b/assets/diagnostics/mtr-backend.py index fbab53c..c46e4ac 100644 --- a/assets/diagnostics/mtr-backend.py +++ b/assets/diagnostics/mtr-backend.py @@ -192,7 +192,7 @@ class Handler(BaseHTTPRequestHandler): # Reads the entire body before responding so the client timer is accurate if parsed.path == "/api/upload" or parsed.path.endswith("/api/upload"): 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 buf = 65536 while received < to_read: diff --git a/x-ui-latest.sh b/x-ui-latest.sh index 41cf91d..5dd0946 100644 --- a/x-ui-latest.sh +++ b/x-ui-latest.sh @@ -479,9 +479,9 @@ server { proxy_http_version 1.1; proxy_set_header X-Real-IP \$remote_addr; proxy_request_buffering off; - client_max_body_size 128m; - proxy_read_timeout 120s; - proxy_send_timeout 120s; + client_max_body_size 600m; + proxy_read_timeout 300s; + proxy_send_timeout 300s; add_header Cache-Control "no-store" always; }