Opened 3 years ago

Closed 3 years ago

#1455 closed defect (invalid)

Status Error 416 after Header-Request "Range" with multiple ranges

Reported by: werk21@… Owned by:
Priority: minor Milestone:
Component: other Version: 1.10.x
Keywords: Cc:
uname -a: Linux HOSTNAME 4.10.0-42-generic #46~16.04.1-Ubuntu SMP Mon Dec 4 15:57:59 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
nginx -V: nginx version: nginx/1.10.3 (Ubuntu)
built with OpenSSL 1.0.2g 1 Mar 2016
TLS SNI support enabled
configure arguments: --with-cc-opt='-g -O2 -fPIE -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2' --with-ld-opt='-Wl,-Bsymbolic-functions -fPIE -pie -Wl,-z,relro -Wl,-z,now' --prefix=/usr/share/nginx --conf-path=/etc/nginx/nginx.conf --http-log-path=/var/log/nginx/access.log --error-log-path=/var/log/nginx/error.log --lock-path=/var/lock/nginx.lock --pid-path=/run/nginx.pid --http-client-body-temp-path=/var/lib/nginx/body --http-fastcgi-temp-path=/var/lib/nginx/fastcgi --http-proxy-temp-path=/var/lib/nginx/proxy --http-scgi-temp-path=/var/lib/nginx/scgi --http-uwsgi-temp-path=/var/lib/nginx/uwsgi --with-debug --with-pcre-jit --with-ipv6 --with-http_ssl_module --with-http_stub_status_module --with-http_realip_module --with-http_auth_request_module --with-http_addition_module --with-http_dav_module --with-http_geoip_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_image_filter_module --with-http_v2_module --with-http_sub_module --with-http_xslt_module --with-stream --with-stream_ssl_module --with-mail --with-mail_ssl_module --with-threads

Description

We use nginx (Ubuntu 16.04) with http2-support. While downloading large pdf-files (ca. 12 MB) with IE 11 (11.49 or 11.0.49) and acrobat reader installed the download breaks after a few mb with status code 416.

Request-Header:

Accept: */*
Accept-Encoding: gzip, deflate
Host: www.example.org
Range: bytes=12081152-12091391, 12091392-12107775, 12107776-12124159
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; rv:11.0) like Gecko

Response-Header:

accept-ranges: bytes
age: 1050
cache-control: max-age=1209600
content-length: 0
content-range: bytes */12490453
content-type: application/pdf
date: Fri, 05 Jan 2018 12:52:42 GMT
etag: "be96d5-55ea8415dac55"
expires: Fri, 19 Jan 2018 12:35:12 GMT
last-modified: Thu, 23 Nov 2017 15:40:27 GMT
server: nginx

Several other requests with only one bytes-range like Range: bytes=12489216-12490452 get content, but this request fails.

With apache2 this request works without problems and IE open the pdf-file.

I could not find any ticket (or other website) describing this problem.

thank you and best regards, kelly.

Change History (2)

comment:1 by Maxim Dounin, 3 years ago

The age: 1050 header and the etag: "be96d5-55ea8415dac55" header format suggest that the response is returned not by nginx, but by something different (an upstream server behind nginx?).

Simple test with a static file of the size in question and the Range header provided works fine here, both via HTTP/1.1:

$ telnet localhost 8080
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
GET /test.pdf HTTP/1.1
Host: x
Range: bytes=12081152-12091391, 12091392-12107775, 12107776-12124159

HTTP/1.1 206 Partial Content
Server: nginx/1.13.9
Date: Sat, 06 Jan 2018 00:22:00 GMT
Content-Type: multipart/byteranges; boundary=00000000001
Content-Length: 43309
Last-Modified: Sat, 06 Jan 2018 00:21:15 GMT
Connection: keep-alive
ETag: "5a50167b-be96d5"

...

and HTTP/2:

$ curl -vvv -k -H 'Range: bytes=12081152-12091391, 12091392-12107775, 12107776-12124159' https://127.0.0.1:8443/test.pdf
...
> GET /test.pdf HTTP/2
> Host: 127.0.0.1:8443
> User-Agent: curl/7.55.0
> Accept: */*
> Range: bytes=12081152-12091391, 12091392-12107775, 12107776-12124159
> 
* Connection state changed (MAX_CONCURRENT_STREAMS updated)!
< HTTP/2 206 
< server: nginx/1.13.9
< date: Sat, 06 Jan 2018 00:26:44 GMT
< content-type: multipart/byteranges; boundary=00000000001
< content-length: 43309
< last-modified: Sat, 06 Jan 2018 00:25:21 GMT
< etag: "5a501771-be96d5"
< 
...

Overall, it looks like a backend (or a caching proxy server?) which isn't able to handle multi-rage requests and returns 416 instead of 200 for some reason. And it doesn't look like an nginx problem, so I'm closing this ticket.

If you are able to reproduce the problem with nginx returning a response (rather than a different server, as in the response provided in the ticket description), please reopen the ticket with detailed explanation on how to reproduce the problem.

comment:2 by Maxim Dounin, 3 years ago

Resolution: invalid
Status: newclosed
Note: See TracTickets for help on using tickets.