Range support in Nexus webserver?


I’m attempting to use the QEMU tool qemu-img to interrogate/download artifacts which are stored in a Nexus repository (3.30.0-01), which results in the following error:

qemu-img info http://nexus:8081/repository/test/file.img
qemu-img: Could not open 'http://nexus:8081/repository/test/file.img': CURL: Error opening file: Server does not support 'range' (byte ranges).

Having compared some network captures from nexus and an apache webserver hosting the same file, the above error appears to be happening as Nexus doesn’t return an “Accept-Ranges” header.


HEAD /test/file.img HTTP/1.1
Host: apache
Accept: */*

HTTP/1.1 200 OK
Date: Mon, 21 Jun 2021 09:38:20 GMT
Server: Apache/2.4.38 (Debian)
Last-Modified: Thu, 17 Jun 2021 13:29:36 GMT
Accept-Ranges: bytes
Content-Length: 1586561024


HEAD /test/file.img HTTP/1.1
Host: nexus:8081
Accept: */*

HTTP/1.1 200 OK
Date: Mon, 21 Jun 2021 09:21:49 GMT
Server: Nexus/3.30.0-01 (OSS)
X-Content-Type-Options: nosniff
Content-Security-Policy: sandbox allow-forms allow-modals allow-popups allow-presentation allow-scripts allow-top-navigation
X-XSS-Protection: 1; mode=block
Last-Modified: Thu, 10 Jun 2021 14:54:37 GMT
Content-Type: text/plain
Content-Length: 1586561024

From testing directly with curl it appears that the Nexus webserver does actually support ranges, however the lack of the Accept-Ranges header is causing qemu-img to error.

Has anyone experienced anything similar or know if this is fixable?


This looks to me like something we’d need to add support for. Feel free to open up a ticket on issues.sonatype.org in the NEXUS project though I don’t know if/when we’d add the support.