Upstream Accept-Ranges not being respected?

Zach Rait zrait at
Fri Nov 26 15:20:22 MSK 2010

Hi folks,

I'm using 0.8.53, and I've been running into an issue with the Accepts-Range
header coupled with X-Accel-Redirect. I'm proxying all non-static requests
to an upstream pool which when passed a particular one-time-use URL will set
X-Accel-Redirect to an internal location to allow the client to download a
protected file. However, despite setting "Accept-Ranges: none" in the
upstream server, nginx is appending a second "Append-Ranges: bytes" header
before hitting the client. This results in the client aborting the initial
download and making several partial followup range requests (which obviously
don't succeed as the URL they're hitting can only resolve once). I've tried
manually setting Accept-Ranges for the internal location, but that just
results in a third Accept-Ranges header being sent to the client in the
initial response. I've even tried completely clearing the Accept-Ranges
headers with ngx_headers_more, but even that failed.

It seems to me like the correct behavior here would be to respect the
upstream server's Accept-Ranges header if it's been set (and preserve it
rather than appending to it) as any followup requests will be to the URL
that was proxied upstream and thus any range requests must be able to be
processed by the upstream servers to succeed.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the nginx mailing list