FULL AI ANALYSIS

NGINX returns 416 Range Not Satisfiable for resumed downloads when using X-Accel-Mirror to an S3‑compatible backend

Generated Oct 30, 2026, 9:42:13 AM

Analysis summary

The mirror flow alters how NGINX constructs the proxied request/response lifecycle: X-Accel-Mirror creates an internal subrequest whose headers and range semantics may be lost or adjusted by buffer/proxy settings. Common causes include: the mirror/internal location not forwarding the original Range header, upstream returning Content-Length vs. Accept-Ranges differences for internal requests, or proxy_buffering/byte-range caching interfering with range response formation. Direct storage works, so the defect lies in the mirrored/proxied internal request path and header handling.

Possible causes

Internal mirror location not forwarding the original Range header to upstream (Range header dropped or replaced)

85%

proxy_buffering or proxy_max_temp_file_size causing NGINX to buffer entire response and invalidate range semantics for subrequests

55%

Upstream object store returns different metadata for internal subrequest URI (missing Accept-Ranges or different Content-Length) due to signed URL or credential differences

40%

Nginx bug or configuration interaction where X-Accel-Mirror subrequest loses proper request method/headers in this release

20%

Suggested fixes

1

Diagnostic step 1

Verify and compare headers for mirrored internal subrequest: add add_header X-Debug-Range $http_range in mirror location and log upstream response headers.

2

Diagnostic step 2

Ensure the mirror/internal location includes proxy_set_header Range $http_range; proxy_set_header Accept-Ranges bytes; so the Range header is forwarded unchanged.

3

Diagnostic step 3

Temporarily disable proxy_buffering and proxy_max_temp_file_size in the mirror/internal location and retest to rule out buffering effects.

4

Diagnostic step 4

If using signed URLs, confirm the internal URI used by the mirror includes the same object key and credentials so upstream returns identical metadata. If necessary, generate a test unsigned object and repeat.

5

Diagnostic step 5

If reproduces on latest stable NGINX, capture a minimal config and open a bug with NGINX or test a newer package on a staging host before production change.