# Upstream Accept-Ranges not being respected?

**URL:** <https://www.ruby-forum.com/t/upstream-accept-ranges-not-being-respected/199691>\
**Category:** NGINX\
**Created:** [November 26, 2010, 1:26pm UTC](https://www.ruby-forum.com/t/upstream-accept-ranges-not-being-respected/199691 "2010-11-26T13:26:41Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dobai-Pataky\_BSSSSl](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/77aa72/32.png) [@Dobai-Pataky\_BSSSSl](https://www.ruby-forum.com/u/Dobai-Pataky_BSSSSl)\
**Post date:** [November 26, 2010, 1:26pm UTC](https://www.ruby-forum.com/t/upstream-accept-ranges-not-being-respected/199691/1 "2010-11-26T13:26:41Z")

</div>

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.

Thanks,  
Zach
