Это старая версия документа.


Установка nginx для модуля Cams

Нужно собрать nginx с модулем flv

apt-get install build-essential
apt-get install libpcre3 libpcre3-dev libssl-dev
cd /usr/src/
wget http://nginx.org/download/nginx-1.9.0.tar.gz
tar -xzvf nginx-1.9.0.tar.gz
cd nginx-1.9.0
./configure --prefix=/usr --conf-path=/etc/nginx/nginx.conf --pid-path=/var/run/nginx.pid --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --with-http_ssl_module --with-http_ssl_module --with-http_realip_module --with-http_addition_module --with-http_sub_module --with-http_dav_module --with-http_flv_module --with-http_gzip_static_module --with-http_stub_status_module
make 
make install

Конфигурационный файл /etc/nginx/nginx.conf

user  www-data;
worker_processes  1;

error_log  logs/error.log;
error_log  logs/error.log  notice;
error_log  logs/error.log  info;

pid        logs/nginx.pid;

events {
    worker_connections  1024;
}

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

    sendfile        on;
    #tcp_nopush     on;

    #keepalive_timeout  0;
    keepalive_timeout  65;

    #gzip  on;

    server {
        listen 8088 ssl;

        ssl_certificate     /usr/abills/Certs/server.crt;
        ssl_certificate_key /usr/abills/Certs/server.key;
        ssl_protocols       TLSv1 TLSv1.1 TLSv1.2;
        ssl_ciphers         HIGH:!aNULL:!MD5;

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

            root /tmp;

            add_header Cache-Control no-cache;
            add_header 'Access-Control-Allow-Origin' '*';
        }

        location / {
           add_header 'Access-Control-Allow-Origin' '*';
           root /var/www/ipcam;
        }

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

}

Перезапускаем nginx

/etc/init.d/nginx restart