nginx:[emerg]未知指令“ gop_cache”

时间:2019-12-17 03:30:54

标签: nginx

我的nginx配置如下:

  rtmp {
    server {
        listen 1935;
        chunk_size 4000;
        application live {
            live on;
            record off;
            #publish_notify on;
            #on_publish http://localhost/auth.php;

            hls on;
            hls_path /home/hls/test;
            hls_fragment 3s;
            hls_playlist_length 32s;
            meta on;
            gop_cache on;
        }
    }
}

但是重新加载时出现此错误:

  

nginx:[emerg]中的未知指令“ gop_cache”   /usr/local/nginx/conf/nginx.conf:133

我的nginx版本是:

nginx version: nginx/1.8.1
built by gcc 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.12)
built with OpenSSL 1.0.2g  1 Mar 2016
TLS SNI support enabled
configure arguments: --with-http_ssl_module --add-module=../nginx-rtmp-module-master

1 个答案:

答案 0 :(得分:0)

您安装的nginx未安装nginx模块nginx-rtmp-module-master

如果您是从源代码安装的nginx,则需要--add-module = nginx-rtmp-module-master

例如:

./configure --add-module=/path/to/nginx-http-flv-module
make
make install

Here is the official description