nginx set flv Content-Type as plain/text

BestBoard

Verified User
Joined
Sep 8, 2006
Messages
199
Hi,
my nginx version is 0.8.54.
i try to stream flv files, but i can't.
i finally find why - the Content-Type defined as text/plain and not as video/x-flv like it should be.

my mime.types file contain video/x-flv definition.
i compile nginx with --with-http_flv_module, and add
location ~ \.flv$ { flv; }
(as i read from http://wiki.nginx.org/HttpFlvStreamModule)

i don't know why it don't change the content-type to the right one.

here is my conf file:
(i comment out all the gzip & proxy things cause i thought that is the reason to my problem - but it isn't)
PHP:
user apache apache; worker_processes  2;  error_log  /var/log/nginx/error_log; pid        /var/run/nginx/nginx.pid;   events {     worker_connections  1024; }  worker_rlimit_nofile 30000;   http {     include       mime.types;     default_type  application/octet-stream;      log_format  main  '$remote_addr - $remote_user [$time_local] $status '                       '"$request" $body_bytes_sent "$http_referer" '                       '"$http_user_agent" "$http_x_forwarded_for"';      access_log  /var/log/nginx/access.log  main;      #client_header_buffer_size   4K;     #client_max_body_size        100000000;     #large_client_header_buffers 16 8K;      #proxy_buffer_size           32K;     #proxy_buffers               64 512K;     #proxy_busy_buffers_size     1024K;       #proxy_temp_file_write_size  1024K;        #client_header_timeout       60;     #client_body_timeout         60;     #send_timeout                120;     #proxy_read_timeout          60;      #proxy_connect_timeout       60;      #proxy_send_timeout          180;        #sendfile        on;     #tcp_nopush     on;     #tcp_nodelay      on;      #keepalive_timeout  20;      reset_timedout_connection  on;      gzip  off;     #gzip_min_length  10240;     #gzip_buffers     32 64k;     #gzip_types       application/x-javascript text/css text/xml text/plain;      server {     listen       81; #default rcvbuf=8192 sndbuf=16384;         server_name  localhost;          access_log  /var/log/httpd/access_log  main;         error_log   /var/log/nginx/error_log info;          location / {             #proxy_pass         http://184.82.152.34/;             #proxy_redirect     off;             #proxy_set_header   Host             $host;             #proxy_set_header   X-Real-IP        $remote_addr;             #proxy_set_header   X-Forwarded-For  $proxy_add_x_forwarded_for;             #root   html;             #index  index.html index.htm;         }          error_page  404              /404.html;          # redirect server error pages to the static page /50x.html         #         error_page   500 502 503 504  /50x.html;         location = /50x.html {             root   html;         }     #    location ~* ^/(phpmyadmin|roundcube)/.+\.(jpg|jpeg|gif|png|ico|css|zip|tar|tgz|gz|rar|bz2|doc|xls|exe|pdf|ppt|txt|tar|wav|bmp|rtf|js|wmv|avi|cur|swf|mp3|wma|htc|cur)$ {         #    root /var/www/html/;         #    expires    30d;         #    access_log    on;         #}     #Static files location         #location ~* ^.+\.(jpg|jpeg|gif|mp3|png|avi|vob|mpg|mpeg|mp4|ico|css|zip|tgz|gz|rar|bz2|doc|xls|exe|pdf|ppt|txt|tar|wav|bmp|rtf|js)$ {     #        root /var/www/html;         #}     location ~ \.flv$ {      default_type  video/x-flv;      root /var/www/html;      flv;     }     location /nginx_status {         stub_status    on;         access_log    on;         allow        all;         #auth_basic    "Restricted";         #auth_basic_user_file    /etc/httpd/conf/extra/htpasswd;     }      } include /usr/local/nginx/etc/virtual.conf; }

seems that it isn't readable from here so i uploaded it:
http://www.cue.co.il/i/cue-9bu9lnw04t.txt

i check the header response:
Code:
[root@server ~]# curl -I http://localhost:81/999.flv
HTTP/1.1 200 OK
Server: nginx/0.8.54
Date: Sun, 17 Apr 2011 08:32:01 GMT
Content-Type: text/plain
Connection: keep-alive
Last-Modified: Sun, 17 Apr 2011 07:19:28 GMT
ETag: "14810b-6c8e38c-4a118186e2000"
Accept-Ranges: bytes
Content-Length: 113828748
any suggestions?
 
Last edited:
Why are you asking here? NGINX has nothing with directadmin. It's not even official supported.

If you want free help, send this question to nginx mailing lists. Or hire somebody to get paid assistance.
 
Back
Top