difficulty adding headers

ura nginx-forum at nginx.us
Sat Jun 28 15:25:30 UTC 2014


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.

so this would appear to be a case of either needing some conditional logic
in the nginx config file or a re-design of the architecture of the elgg php
application. this was already highlighted in a related thread in the elgg
community, though not to resolve this explicit problem - only to improve
performance.
(https://community.elgg.org/discussion/view/1653829/anyone-excited-to-team-up-to-create-an-enhanced-video-plugin-for-elgg)

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,251236,251284#msg-251284



More information about the nginx mailing list