NGINX send 206 but wget retries

Roger Fischer roger at
Fri Aug 2 23:05:28 UTC 2019


I am making a byte range request to NGINX using wget. NGINX responds with status code 206 (partial content), but instead of downloading the content, wget retries.


wget -S '' --header="Range: bytes=0-1023"

Output from wget:

--2019-08-02 15:36:44--
Resolving (
Connecting to (||:80... connected.
HTTP request sent, awaiting response... 
  HTTP/1.1 206 Partial Content
  Server: nginx/1.17.0a
  Date: Fri, 02 Aug 2019 22:36:45 GMT
  Content-Type: video/MP2T
  Content-Length: 1024
  Connection: keep-alive
  Access-Control-Allow-Origin: *
  Access-Control-Allow-Headers: Range
  Access-Control-Allow-Methods: GET
  Timing-Allow-Origin: *
  Access-Control-Max-Age: 86400
  Access-Control-Expose-Headers: X-Server-IP,Location
  Age: 86555
  Content-Range: bytes 0-1023/135090032

Then wget sends the request again, with the same result.

The same wget request to the origin succeeds. The data is cached properly (wget without the range header succeeds).

Adding —debug to the wget provides not much more.

Registered socket 3 for persistent reuse.
Disabling further reuse of socket 3.
Closed fd 3

There is nothing in the NGINX error log.

I am speculating that NGINX closes the connection before the data is delivered. But why?



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

More information about the nginx mailing list