Как правильно настроить config?

Как правильно настроить config? Нужно сделать VOD онлайн трансляцию в формате HLS.
Всё находиться на локально машине.
В папке HTML лежит видео файл auto.mp4, вот его нужно воспроизвести, чтобы играл как онлайн.
Сервер - Nginx, FFmpeg, Nginx-rtmp.
events {
    worker_connections  1024;
}


rtmp {
      server {
                  listen 1935;
                  application testlive {
                        live on;
                        hls on;
                        hls_path /tmp/hls;
                        hls_nested on;
                        allow publish 127.0.0.1;
                        deny publish all;
                  }
      }
}


http {
    include       mime.types;
    default_type  application/octet-stream;
    sendfile        on;

    keepalive_timeout  65;


    server {

     listen 80 default_server;
     charset utf-8;

     root /usr/local/nginx/html;
     index index.php index.html index.htm;

     server_name server_domain_name_or_IP;

     location /hls {
           types {
               application/vnd.apple.mpegurl m3u8;
                 }
         alias /tmp/hls;
     }

     location / {
        try_files $uri $uri/ =404;
     }

     error_page 404 /404.html;
     error_page 500 502 503 504 /50x.html;
     location = /50x.html {
         root /usr/local/nginx/html;
     }

     location ~ \.php$ {
         try_files $uri =404;
         fastcgi_split_path_info ^(.+\.php)(/.+)$;
         fastcgi_pass unix:/var/run/php5-fpm.sock;
         fastcgi_index index.php;
         include fastcgi_params;
     }
 }
  • Вопрос задан
  • 2631 просмотр
Пригласить эксперта
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы