difficulty adding headers

Maxim Dounin mdounin at mdounin.ru
Tue Jul 1 00:33:45 UTC 2014


On Mon, Jun 30, 2014 at 04:34:51PM -0400, ura wrote:

> ok, thanks.
> 1. i was thinking that this was the case, based on the results i have seen,
> yes.
> 2. ah, ok - i didn't appreciate that. i found this page with php code:
> http://licson.net/post/stream-videos-php/
> is there a standard / recommended way to approach this with nginx?

Streaming videos with php is silly, so recommended approach is 
"Don't do that".

> 3. i believe the problem i am encountering is that i am unable to explicitly
> redirect file requests for a specific path (e.g. a path i create for use
> with streaming videos, called 'stream') to a specific static address in the
> server's filestorage, because every request is being handled via a php file
> and there is a .php location block in the site config. so if i create a
> location:
> location /stream/ {
>  internal;
>  root /var/www/data/;
> }
> and then navigate to www.mysite.tld/stream/blah.mp4

First of all, try removing "internal", as it will prevent handling 
of all external requests.

> what is occuring is that the stream block is never processed and the .php
> block in the config is triggered instead.. i'm not 100% clear on why this is
> occurring.
> here's a sample elgg nginx config file that is basically similar to mine:
> https://gist.github.com/hellekin/755617

If you don't understand how requests are handled in your config, 
it's probably good idea to throw it away and start with something 
simple without regex locations, rewrites, if's and so on.

> i have created a new thread in the forum here for this topic, since you have
> really helpfully addressed my original question and the topic has changed.
> (new thread: http://forum.nginx.org/read.php?2,251295)

Just a note: it's not forum, it's a mailing list.

Maxim Dounin

More information about the nginx mailing list