首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >nginx rtmp服务器的统计数据

nginx rtmp服务器的统计数据
EN

Server Fault用户
提问于 2018-10-30 15:47:53
回答 3查看 13.9K关注 0票数 0

我正在尝试将nginx的stats作为rtmp服务器,下面是我的配置文件,但我在http://ip:8080/stat.xsl上得到了403 (也尝试了http://ip/stat.xsl提供404,http://ip:8080/stat/stat.xsl给出一个空白页,没有错误)。

我从这里复制了这些设置:https://github.com/arut/nginx-rtmp-module

不知道怎么回事..。

我需要找到一种从rtmp服务器中提取统计数据的方法,或者至少找到一种获得活动连接的方法。

谢谢。

代码语言:javascript
复制
rtmp {
        server {
        listen 1935;
        chunk_size 4000;
        allow play all;

        application live {
                allow play all;
                live on;
                hls on;
                hls_nested on;
                hls_path /HLS/hls;
                hls_fragment 10s;
                record off;
                }
        }
}


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

        server {
                listen 8080;
                location /hls {
                                types {
                                        application/vnd.apple.mpegurl m3u8;
                                }
                alias /HLS/hls;
                add_header Cache-Control no-cache;
                }
                location /stat {
                        rtmp_stat all;
                        rtmp_stat_stylesheet stat.xsl;
                }
                location /stat.xsl {
                root /root/nginx-rtmp-module-dev/stat.xsl/;
                }
        }
}

更新:当我访问http://IP:8080/stat/stat.xsl时,我在console中看到了这个,我认为这是相关的:Resource interpreted as Stylesheet but transferred with MIME type text/xml: http://IP:8080/stat/stat.xsl

EN

回答 3

Server Fault用户

发布于 2018-10-30 15:55:32

然后检查/root/nginx-rtmp-module-dev/stat.xsl/stat.xsl及其父目录的权限。您将发现web服务器无法读取/root,因此您将得到一个403错误。

若要解决此问题,请将文件移动到适当的位置,并将nginx配置更改为匹配。

票数 1
EN

Server Fault用户

发布于 2019-05-17 11:03:33

我认为问题已经解决了。但我一直在努力解决同样的问题,并找到了解决方案,即我们需要使用路由url来访问统计数据,而不是使用文件名。例如: example.com/stat,然后stat将重定向到实际页面。在这里,我们可以看到与RTMP统计表。

票数 0
EN

Server Fault用户

发布于 2019-08-05 20:07:12

nginx-rtmp-stat.xsl复制到nginx html文件夹。

将stat.xsl路径设置为nginx-rtmp html文件夹

代码语言:javascript
复制
location /stat.xsl {
                root /path-to-nginx-rtmp-html-folder/;
}

然后去http://yourip/stat

票数 0
EN
页面原文内容由Server Fault提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://serverfault.com/questions/937903

复制
相关文章

相似问题

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