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

huandu nginx-forum at nginx.us
Sat Aug 7 13:52:29 MSD 2010


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'

* About to connect() to wiki.nginx.org port 80
*   Trying 69.168.53.49... connected
* Connected to 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
> 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 left intact

Thanks,
- Huan

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,117223,117223#msg-117223




More information about the nginx mailing list