# Nginx always returns 206 with HTTP header 'Range: bytes=0-'

**URL:** <https://www.ruby-forum.com/t/nginx-always-returns-206-with-http-header-range-bytes-0/192871>\
**Category:** NGINX\
**Created:** [August 7, 2010, 11:53am UTC](https://www.ruby-forum.com/t/nginx-always-returns-206-with-http-header-range-bytes-0/192871 "2010-08-07T11:53:12Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![huandu](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/7feea3/32.png) [@huandu](https://www.ruby-forum.com/u/huandu)\
**Post date:** [August 7, 2010, 11:53am UTC](https://www.ruby-forum.com/t/nginx-always-returns-206-with-http-header-range-bytes-0/192871/1 "2010-08-07T11:53:12Z")

</div>

When requesting a static file with HTTP header “Range: bytes=0-”, nginx  
always return 206 Partial Content. Is it a bug?

This issue can be reproduced like this:

curl -v -o /dev/null -H “Range: bytes=0-”  
‘[http://wiki.nginx.org/local/propaganda/postgresql.gif](http://wiki.nginx.org/local/propaganda/postgresql.gif)’

- About to connect() to [wiki.nginx.org](http://wiki.nginx.org) port 80
- Trying 69.168.53.49… connected
- Connected to [wiki.nginx.org](http://wiki.nginx.org) (69.168.53.49) port 80

> GET /local/propaganda/postgresql.gif HTTP/1.1  
> User-Agent: curl/7.15.5 (x86\_64-redhat-linux-gnu) libcurl/7.15.5  
> OpenSSL/0.9.8b zlib/1.2.3 libidn/0.6.5  
> Host: [wiki.nginx.org](http://wiki.nginx.org)  
> Accept: _/_  
> Range: bytes=0-

\< HTTP/1.1 206 Partial Content  
\< Server: nginx/0.8.47  
\< Date: Sat, 07 Aug 2010 09:35:58 GMT  
\< Content-Type: image/gif  
\< Content-Length: 196  
\< Last-Modified: Tue, 06 Nov 2007 20:42:04 GMT  
\< Connection: keep-alive  
\< Expires: Mon, 06 Sep 2010 09:35:58 GMT  
\< Cache-Control: max-age=2592000  
\< Content-Range: bytes 0-195/196  
% Total % Received % Xferd Average Speed Time Time Time  
Current  
Dload Upload Total Spent Left  
Speed  
100 196 100 196 0 0 1329 0 --:–:-- --:–:-- --:–:–  
0Connection #0 to host [wiki.nginx.org](http://wiki.nginx.org) left intact

Thanks,

- Huan

Posted at Nginx Forum:

> **[Nginx always returns 206 with HTTP header 'Range: bytes=0-'](https://forum.nginx.org/read.php?2,117223,117223#msg-117223)**
>
> When requesting a static file with HTTP header "Range: bytes=0-", nginx always return 206 Partial Content. Is it a bug? This issue can be reproduced like this: curl -v -o /dev/null -H "Range: bytes=0-"...

---

<div class="post-metadata">

**Author:** ![huandu](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/7feea3/32.png) [@huandu](https://www.ruby-forum.com/u/huandu)\
**Post date:** [August 7, 2010, 12:41pm UTC](https://www.ruby-forum.com/t/nginx-always-returns-206-with-http-header-range-bytes-0/192871/2 "2010-08-07T12:41:48Z")

</div>

On Sat, Aug 07, 2010 at 05:52:29AM -0400, huandu wrote:

> - Connected to [wiki.nginx.org](http://wiki.nginx.org) (69.168.53.49) port 80  
> \< Content-Type: image/gif  
> 100 196 100 196 0 0 1329 0 --:–:-- --:–:-- --:–:–  
> 0Connection #0 to host [wiki.nginx.org](http://wiki.nginx.org) left intact

Apache does the same:

curl -v -o /dev/null -H “Range: bytes=0-” [http://apache.org/robots.txt](http://apache.org/robots.txt)

- About to connect() to [apache.org](http://apache.org) port 80 (#0)
- Trying 140.211.11.131… connected
- Connected to [apache.org](http://apache.org) (140.211.11.131) port 80 (#0)

> GET /robots.txt HTTP/1.1  
> User-Agent: curl/7.19.7 (universal-apple-darwin10.0) libcurl/7.19.7 OpenSSL/0.9.8l zlib/1.2.3  
> Host: [apache.org](http://apache.org)  
> Accept: _/_  
> Range: bytes=0-

% Total % Received % Xferd Average Speed Time Time Time  
Current  
Dload Upload Total Spent Left  
Speed  
0 0 0 0 0 0 0 0 --:–:-- --:–:-- --:–:–  
0\< HTTP/1.1 206 Partial Content  
\< Date: Sat, 07 Aug 2010 10:39:52 GMT  
\< Server: Apache/2.3.7-dev (Unix) mod\_ssl/2.3.7-dev OpenSSL/1.0.0a  
\< Last-Modified: Tue, 16 May 2006 11:57:46 GMT  
\< ETag: “910d4f-2f-413e682e08280”  
\< Accept-Ranges: bytes  
\< Content-Length: 47  
\< Cache-Control: max-age=86400  
\< Expires: Sun, 08 Aug 2010 10:39:52 GMT  
\< Vary: Accept-Encoding  
\< Content-Range: bytes 0-46/47  
\< Content-Type: text/plain  
\<  
{ [data not shown]  
0 47 0 47 0 0 77 0 --:–:-- --:–:-- --:–:–  
152\* Connection #0 to host [apache.org](http://apache.org) left intact

- Closing connection #0

–  
Igor S.

> **[Igor Sysoev](http://sysoev.ru/en/)**
