Welcome! Log In Create A New Profile

Advanced

Re: difficulty adding headers

Maxim Dounin
June 27, 2014 12:50PM
Hello!

On Fri, Jun 27, 2014 at 11:50:47AM -0400, ura wrote:

> i need to ensure the Accept-Ranges header is present to serve video files
> while supporting forward/backwards seeking.
> i notice in many tutorials for nginx that this header is shown as being
> present in server response headers by default, yet not on my present setup.
>
> i have used the following to add the header manually in the relevant places,
> yet so far have not been successful:

You shouldn't try to add Accept-Ranges header manually. It will
be added automatically when nginx supports range requests to the
resource in question.

> # streamable mp4
> location ~* \.(mp4|mp4a)$
> #location ~* \.mp4$
> #location ^~ /file/download/
> {
> mp4;

Range requests to responses of mp4 module are supported starting
at 1.5.13 (previously, range requests was supported only for files
returned without modifications).

If it doesn't work for you, it's probably time to upgrade.

[...]

> # tell nginx that final HTTP Status Code should be 206 not 200
> return 206;

This is just wrong, as it prevents nginx from returning a
requested resource and unconditionally returns 206 response with
an empty response body.

Again, you shouldn't try to return 206 manually. The 206 response
code is set automatically when a requested range is returned
(instead of the full response).

--
Maxim Dounin
http://nginx.org/

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

difficulty adding headers

ura June 27, 2014 11:50AM

Re: difficulty adding headers

Maxim Dounin June 27, 2014 12:50PM

Re: difficulty adding headers

ura June 27, 2014 12:54PM

Re: difficulty adding headers

ura June 27, 2014 12:58PM

Re: difficulty adding headers

Maxim Dounin June 27, 2014 02:08PM

Re: difficulty adding headers

ura June 27, 2014 02:23PM

Re: difficulty adding headers

ura June 27, 2014 02:50PM

Re: difficulty adding headers

Maxim Dounin June 27, 2014 03:22PM

Re: difficulty adding headers

ura June 27, 2014 07:26PM

Re: difficulty adding headers

Maxim Dounin June 27, 2014 10:02PM

Re: difficulty adding headers

ura June 28, 2014 10:44AM

Re: difficulty adding headers

ura June 28, 2014 12:17PM

Re: difficulty adding headers

Maxim Dounin June 30, 2014 03:18PM

Re: difficulty adding headers

ura June 30, 2014 04:34PM

Re: difficulty adding headers

Maxim Dounin June 30, 2014 08:34PM

Re: difficulty adding headers

ura July 04, 2014 09:48AM

Re: difficulty adding headers

Maxim Dounin July 04, 2014 12:36PM

Re: difficulty adding headers

Sophie Moussion July 25, 2014 03:40AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 309
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