Welcome! Log In Create A New Profile

Advanced

Re: difficulty adding headers

Maxim Dounin
June 30, 2014 03:18PM
Hello!

On Sat, Jun 28, 2014 at 11:25:30AM -0400, ura wrote:

> after more exploration, i see that files which are placed in the root of my
> site can be preloaded and seeked correctly when played via the video.js
> package or directly as a video element.
> however, the videos that are played via the php application that runs my
> site are stored outside of the root directory of the site and i suspect that
> this is the cause of them not being streamed. (i am using the elgg social
> framework (www.elgg.org)). when i request one of these files from it's
> extermal/absolute url via curl, the accept_ranges header is not present, yet
> the header IS present when i place the same file at the public root of the
> site manually and request the file via curl.
>
> e.g. the site is at : /var/www/html/mysite/
> and the videos are at: /var/www/data/paths/
>
> so the root directive for the server in the nginx config is
> /var/www/html/mysite/
>
> what appears to be occurring is that the request for the mp4 file is being
> processed via php so is using the .php location in my nginx config instead
> of the .mp4 config... thus the mp4; directive is not being triggered for mp4
> files.
> when i place the mp4 directive inside the php location block i just get
> prompted to download a file whenever i navigate to a php page.

In no particular order:

1. For HTML5 video streaming to work, you don't need "mp4"
directive in your nginx config. It's only needed for flash-based
pseudo streaming. HTML5 video streaming will work fine without
the mp4 module, using standard HTTP range requests.

2. If php is used to return a response, it's php code
responsibility to return various headers, including Accept-Ranges,
as well as byte-ranges support itself.

3. It would be more or less trivial to serve static files with
nginx regardless of their location in the filesystem hierarchy.
There are "root" and "alias" directives which can be set at
location{} level, see http://nginx.org/r/root and
http://nginx.org/r/alias.

4. (Following you next message) X-Accel-Redirect can be used to
effectiently return static files, see
http://wiki.nginx.org/XSendfile for some links.

--
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: 90
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready