在Nginx RTMP模块统计文件上获取404

时间:2015-07-13 08:30:52

标签: xslt nginx module rtmp

当我在Nginx RTMP模块中设置统计视图时,我不明白为什么会得到404。

我所关注的说明非常straightforward,特别是here

我正在Google Cloud上使用Ubuntu VM。

我已将stat.xsl文件放在/ var / www / html

这是Nginx资产的默认位置,如在sites-enabled / default文件夹中指定的那样:

server {
        listen 80 default_server;
        listen [::]:80 default_server;

        root /var/www;

        index index.html index.htm index.nginx-debian.html;

        server_name _;

     location / {
                # First attempt to serve request as file, then
                # as directory, then fall back to displaying a 404.
                try_files $uri $uri/ =404;
        }

}

这是我在我的nginx.conf中复制/粘贴和修改的片段:

server{
                listen 80;
                 location /stat {
            rtmp_stat all;
            rtmp_stat_stylesheet stat.xsl;
                 }


                location /stat.xsl {
            # you can move stat.xsl to a different location
            # under linux you could use /var/user/www for example
                root html;
                }

        }

这里的目标是能够输入[my-ip-address / stat并获取格式化的xsl内容。

这里有什么东西我没有得到 - 请帮忙吗?

1 个答案:

答案 0 :(得分:0)

您是否尝试过键入/ statOR?

 server {
    listen      80;
    server_name localhost;

    # rtmp statistics
    location /stat {
        rtmp_stat all;
        rtmp_stat_stylesheet stat.xsl;
    }

    location /stat.xsl {
        # you can move stat.xsl to a different location
        # under linux you could use /var/user/www for example
        root html;