Welcome! Log In Create A New Profile


NGINX send 206 but wget retries

Roger Fischer
August 02, 2019 07:06PM

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 'http://cache.example.com/video5.ts' --header="Range: bytes=0-1023"

Output from wget:

--2019-08-02 15:36:44-- http://cache.example.com/video5.ts
Resolving cache.example.com (cache.example.com)...
Connecting to cache.example.com (cache.example.com)||: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?



nginx mailing list
Subject Author Posted

NGINX send 206 but wget retries

Roger Fischer August 02, 2019 07:06PM

Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 255
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready