首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >错误:未知指令"rtmp_stat“(使用NOALBS .conf文件时NGNIX失败)

错误:未知指令"rtmp_stat“(使用NOALBS .conf文件时NGNIX失败)
EN

Stack Overflow用户
提问于 2021-05-01 20:06:45
回答 1查看 195关注 0票数 1

我以前从未使用过Linux或Raspberry Pi,但为了创建自己的RTMP服务器,我买了一个。我用NGINX做了一个,并让它工作起来。现在,我正在尝试整合NOALBS以获得更多功能。我将我的工作.conf重命名为nginx-old.conf并复制到NOALBS .conf中,现在NGINX失败并显示此错误。

代码语言:javascript
复制
nginx: [emerg] unknown directive "rtmp_stat" in /etc/nginx/nginx.conf:26
nginx: configuration file /etc/nginx/nginx.conf test failed
nginx.service: Control process exited, code=exited, status=1/FAILURE
nginx.service: Failed with result 'exit-code'.

我的.conf如下:

代码语言:javascript
复制
worker_processes 1;

events {
        worker_connections 1024;
}

http {
    sendfile off;
    tcp_nopush on;
    directio 512;
    include mime.types;
    default_type application/octet-stream;
    ignore_invalid_headers on;
    log_format compression '';

    server {
        listen      80;
        server_name localhost;

        # This URL provides RTMP statistics in XML
        location /stat {
            if ($request_method = "GET") {
                add_header "Access-Control-Allow-Origin"  *;
            }

            rtmp_stat all;

            # Use this stylesheet to view XML as web page
            # in browser
            rtmp_stat_stylesheet /stat.xsl;
        }

        location /stat.xsl {
            # XML stylesheet to view RTMP stats.
            # Copy stat.xsl wherever you want
            # and put the full directory path here
            # root /path/to/stat.xsl/;
            root /var/www/html/stat.xsl;

        }

        location /control {
            rtmp_control all;
        }
    }
}

rtmp {
    log_format compression '';

    server {
        listen 1935;
        ping 30s;
        notify_method get;
        chunk_size 8192;
        ack_window 8192;
        sync 4ms;
        interleave on;
        access_log logs/rtmp-access.log compression;

        # Stream to "rtmp://IPHERE/publish/live".
        application publish {
            live on;
            wait_video on;
            wait_key on;
            exec_options on;
            publish_notify on;
            play_restart on;
            drop_idle_publisher 4s;
            idle_streams off;
            sync 4ms;
            interleave on;
        }
    }
}

我所编辑的唯一内容实际上是添加stat.xsl路径和Pi的IP地址(我在这里删除了它们)。有人能帮我吗?

EN

回答 1

Stack Overflow用户

发布于 2021-07-17 04:42:57

添加此标题:

代码语言:javascript
复制
user www-data;
worker_processes auto;
pid /run/nginx.pid;
include /etc/nginx/modules-enabled/*.conf;
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/67346083

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档