nginx 스 트림 미디어 재생 서비스 구축

1526 단어
설치 에 필요 한 시스템 의존 패키지
yum -y install gcc openssl-devel pcre-devel httpd-tools gcc-c++


다운로드 nginx
wget http://nginx.org/download/nginx-1.14.0.tar.gz

스트레스 를 풀다
tar zxvf nginx-1.14.0.tar.gz


디렉토리 에 들어가다
cd nginx-1.14.0


세우다
 ./configure --prefix=/usr/local/nginx --with-http_ssl_module --with-http_mp4_module --with-http_flv_module

컴 파일 설치
make && make install

단축 키 만 들 기
ln -s /usr/local/nginx/sbin/nginx  /usr/sbin/

설정 수정

worker_processes  1;
events {
    worker_connections  1024;
}

http {
    include       mime.types;
    default_type  application/octet-stream;
    limit_conn_zone $binary_remote_addr zone=addr:5m;

    sendfile        on;
    keepalive_timeout  65;

    server {
        listen       80;
        server_name  localhost;
        location / {
            root   html;
            index  index.html index.htm;
        }
        location ~ \.flv$ {
            flv;
            limit_conn addr 4;
            limit_rate 1024k;
        }
        location ~ \.mp4$ {
            mp4;
            limit_conn addr 4;
            limit_rate 1024k;
        }

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

}

설정 검사
nginx -t

시작 서비스
nginx

좋은 웹페이지 즐겨찾기