From e736e98f7ab0bba30cfccf04867dc264308d7d80 Mon Sep 17 00:00:00 2001 From: user Date: Thu, 25 Sep 2025 13:06:40 +0300 Subject: [PATCH] tus /files --- nginx.conf | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/nginx.conf b/nginx.conf index 5bceb9c..0b1ce50 100644 --- a/nginx.conf +++ b/nginx.conf @@ -124,6 +124,34 @@ server { proxy_set_header X-Forwarded-Host $host; proxy_set_header X-Request-Id $req_id; add_header Access-Control-Expose-Headers "Location, Upload-Offset, Tus-Version, Tus-Resumable, Tus-Max-Size, Tus-Extension" always; + + if ($request_method = OPTIONS) { return 204; } + } + + location = /files { + return 308 /files/; + } + + location /files/ { + # Direct file access through tusd (GET/HEAD support, resumable resume) + proxy_pass http://tusd_backend; + proxy_http_version 1.1; + proxy_request_buffering off; + proxy_buffering off; + proxy_max_temp_file_size 0; + proxy_redirect off; + proxy_read_timeout 600s; + proxy_send_timeout 600s; + proxy_set_header Connection ""; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Request-Id $req_id; + add_header Access-Control-Expose-Headers "Location, Upload-Offset, Tus-Version, Tus-Resumable, Tus-Max-Size, Tus-Extension" always; + + if ($request_method = OPTIONS) { return 204; } } # API