nginx播放视频验证方式

rtmp点播,使用on_play方法,调用一个验证地址,验证地址要返回状态码。根据状态码判断是否可以播放。2XX可播放,4XX不可播放。

http点播,nginx中加入ngx_http_auth_request_module模块,原理与rtmp类似。

公司产品-学考云-WebFiles
                location /xkyWebFiles/ {
                #auth_request /auth;
                proxy_pass    http://127.0.0.1:18888/xkyWebFiles/;
                proxy_set_header Host $host;  
                }
                #location = /auth {
                #proxy_pass http://127.0.0.1:17001/TestProject/Test;
                #proxy_pass_request_body off;
                #proxy_set_header Content-Length "";
                #proxy_set_header X-Original-Uri $request_uri;
                #}

rtmp {

        server{
                listen 1936;
                application WebFiles{
                        play "/data2/WebFiles";

                }
                application xkyWebFiles{
                        play "/data2/xkyWebFiles";
                        #on_play http://182.92.159.70:17001/TestProject/Test200;
                }
                application fydjWebFiles{
                        play "/data2/fydjWebFiles";

                }
        }
}

 

posted @ 2018-03-26 17:34  杯中红茶  阅读(611)  评论(0编辑  收藏  举报