Using compiled from source Nginx 0.6.31 to stream flv

Thomas iamkenzo at gmail.com
Thu Jun 26 16:47:01 MSD 2008


Hi list,

I was able to stream flv files on my local dev machine, but now that I
moved to a remote server, I get the following error message when
trying to scrub through my video using FLV media player:

[warn] 4669#0: *75 an upstream response is buffered to a temporary
file /usr/local/nginx/proxy_temp/5/00/0000000005 while reading
upstream, client: xx.xx.xx.xx, server: nginx, request: "GET
/videos/some-video.flv?start=2706564 HTTP/1.1", upstream:
"http://10.0.0.2:3100/videos/some-video.flv?start=2706564", host:
"www.mysite.com"

And the video starts back at the beginning. What is going on? And what
does the error message mean?

I remember Igor saying that the streamed flv must be a static file and
cannot be proxied, is that what's happening to me? But I have in my
config file, rules that are supposed to serve directly static files
from the hard drive.

My setup is as following:
1) Nginx 0.6.31 compiled from source
2) Rails app running on a VM at IP 10.0.0.2
3) Nginx running on a VM at IP 10.0.0.1
4) The host server redirects packets to the Nginx VM, which then
redirects them to the Rails VM
5) The public folder of rail where the video resides is actually an
NFS folder shared by the Nginx VM, so Nginx has direct access to the
flv files on the hard drive.

Here is my configuration file for serving static content:
---
upstream my_app {
  server 10.0.0.2:3100 weight=2;
  server 10.0.0.2:3101;
}

  location / {
    root      /home/thomas/rails_apps/my_app/public;
    index     index.html index.htm;

    proxy_redirect      off;

    proxy_set_header    X-Real-IP $remote_addr;
    proxy_set_header    X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header    Host $http_host;

    if (-f $request_filename) {
      break;
    }

    if (-f $request_filename/index.html) {
      rewrite (.*) $1/index.html break;
    }

    if (-f $request_filename.html) {
      rewrite (.*) $1.html break;
    }

    if (!-f $request_filename) {
      proxy_pass http://my_app;
      break;
    }
  } # End of the location /

  location ~ /videos/\.flv$ {
    root  /home/thomas/rails_apps/my_app/public/videos;
    flv;
  } # End of location
---

Best regards,





More information about the nginx mailing list