I'm hosting a 2.9MB MP3 file with Nginx. When I navigate to its URL using Chrome on Android, there are two requests made: one normal request, and one two-byte range request.
When I copy the first request as a cURL command and execute it on Mac OS X, it downloads the file in its entirety. However, on Android only 3.7 KB are downloaded before the two-byte range request is fired off. Nginx obediently responds with only two bytes of data, and the audio controls displayed in Chrome are left non-functional.
I've tried setting max_ranges 0
, disabling etags, gzip, etc. I can't seem to get Chrome to download the rest of the file.
First request:
GET /yt/test.mp3 HTTP/1.1
Host: xxx.xxx.xx.xxx
Connection: keep-alive
Pragma: no-cache
Cache-Control: no-cache
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Linux; Android 6.0.1; Nexus 6P Build/MMB29Q) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.95 Mobile Safari/537.36
Accept-Encoding: gzip, deflate, sdch
Accept-Language: en-US,en;q=0.8
Response:
HTTP/1.1 200 OK
Server: nginx
Date: Mon, 15 Feb 2016 01:12:31 GMT
Content-Type: audio/mpeg
Content-Length: 2891369
Last-Modified: Mon, 15 Feb 2016 00:26:18 GMT
Connection: keep-alive
ETag: "56c11b2a-2c1e69"
X-Frame-Options: SAMEORIGIN
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Accept-Ranges: bytes
Second request:
GET /yt/test.mp3 HTTP/1.1
Host: xxx.xxx.xx.xxx
Connection: keep-alive
Pragma: no-cache
Cache-Control: no-cache
User-Agent: Mozilla/5.0 (Linux; Android 6.0.1; Nexus 6P Build/MMB29Q) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.95 Mobile Safari/537.36
Accept: */*
Referer: https://xxx.xxx.xx.xxx/yt/test.mp3
Accept-Encoding: gzip, deflate, sdch
Accept-Language: en-US,en;q=0.8
Range: bytes=0-1
Response:
HTTP/1.1 206 Partial Content
Server: nginx
Date: Mon, 15 Feb 2016 01:12:32 GMT
Content-Type: audio/mpeg
Content-Length: 2
Last-Modified: Mon, 15 Feb 2016 00:26:18 GMT
Connection: keep-alive
ETag: "56c11b2a-2c1e69"
X-Frame-Options: SAMEORIGIN
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Content-Range: bytes 0-1/2891369