Welcome! Log In Create A New Profile

Advanced

Nginx is not accepting range of bytes

Posted by thebravoman 
This forum is currently read only. You can not log in or make any changes. This is a temporary situation.
Nginx is not accepting range of bytes
April 03, 2014 02:52AM
I am using nginx to serve videos from the file system. I would like to enable range request.

Currently this is the result returned for my file

curl -I fileurl
HTTP/1.1 200 OK
Server: nginx
Date: Sat, 29 Mar 2014 06:41:41 GMT
Content-Type: video/mp4
Content-Length: 15603963
Last-Modified: Sat, 04 Jan 2014 15:02:26 GMT
Connection: keep-alive
Keep-Alive: timeout=300
Accept-Ranges: bytes

But if I send curl --header "Range: bytes=0-50" fileurl

the whole file is downloaded while I expect only the first 50 bytes.

This is the server in nginx config:

server {
listen 80;
server_name myserver;
error_log logs/myserver.error.log;
access_log logs/myserver.access.log;

root /srv/myserver;

#add_header Accept-Ranges;
add_header Accept-Ranges bytes;
}

Do I have to enable anything else? How could I allow range requests for the files?

Online Users

Guests: 293
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready