windows下搭建基于nginx的rtmp服务器

2023-05-16

1. 下载 nginx 1.7.11.3 Gryphon
下载链接: http://nginx-win.ecsds.eu/download/nginx 1.7.11.3 Gryphon.zip
下载完成后解压;
将解压后的目录名:
  nginx 1.7.11.3 Gryphon
改成:
  nginx-1.7.11.3-Gryphon

2. 下载服务器状态检查程序 stat.xsl
https://github.com/arut/nginx-rtmp-module/

将nginx-rtmp-module-master.zip解压后复制到目录:nginx-1.7.11.3-Gryphon下,
保证stat.xls的目录为:
nginx-1.7.11.3-Gryphon\nginx-rtmp-module\stat.xsl

3. 配置文件 conf\nginx-win-rtmp.conf 内容如下:

#user  nobody;
# multiple workers works !
worker_processes  2;

#error_log  logs/error.log;
#error_log  logs/error.log  notice;
#error_log  logs/error.log  info;

#pid        logs/nginx.pid;

events {
    worker_connections  8192;
    # max value 32768, nginx recycling connections+registry optimization = 
    #   this.value * 20 = max concurrent connections currently tested with one worker
    #   C1000K should be possible depending there is enough ram/cpu power
    # multi_accept on;
}

rtmp {
    server {
        listen 1935;
        chunk_size 4000;
        application live {
             live on;
        }
    }
}

http {
    #include      /nginx/conf/naxsi_core.rules;
    include       mime.types;
    default_type  application/octet-stream;

    #log_format  main  '$remote_addr:$remote_port - $remote_user [$time_local] "$request" '
    #                  '$status $body_bytes_sent "$http_referer" '
    #                  '"$http_user_agent" "$http_x_forwarded_for"';

    #access_log  logs/access.log  main;

#     # loadbalancing PHP
#     upstream myLoadBalancer {
#         server 127.0.0.1:9001 weight=1 fail_timeout=5;
#         server 127.0.0.1:9002 weight=1 fail_timeout=5;
#         server 127.0.0.1:9003 weight=1 fail_timeout=5;
#         server 127.0.0.1:9004 weight=1 fail_timeout=5;
#         server 127.0.0.1:9005 weight=1 fail_timeout=5;
#         server 127.0.0.1:9006 weight=1 fail_timeout=5;
#         server 127.0.0.1:9007 weight=1 fail_timeout=5;
#         server 127.0.0.1:9008 weight=1 fail_timeout=5;
#         server 127.0.0.1:9009 weight=1 fail_timeout=5;
#         server 127.0.0.1:9010 weight=1 fail_timeout=5;
#         least_conn;
#     }

    sendfile        off;
    #tcp_nopush     on;

    server_names_hash_bucket_size 128;

## Start: Timeouts ##
    client_body_timeout   10;
    client_header_timeout 10;
    keepalive_timeout     30;
    send_timeout          10;
    keepalive_requests    10;
## End: Timeouts ##

    #gzip  on;

    server {
        listen       80;
        server_name  localhost;


        location /stat {
            rtmp_stat all;
            rtmp_stat_stylesheet stat.xsl;
        }
        location /stat.xsl {
            root nginx-rtmp-module/;
        }
        location /control {
            rtmp_control all;
        }

        #charset koi8-r;
        #access_log  logs/host.access.log  main;

        ## Caching Static Files, put before first location
        #location ~* \.(jpg|jpeg|png|gif|ico|css|js)$ {
        #    expires 14d;
        #    add_header Vary Accept-Encoding;
        #}

# For Naxsi remove the single # line for learn mode, or the ## lines for full WAF mode
        location / {
            #include    /nginx/conf/mysite.rules; # see also http block naxsi include line
            ##SecRulesEnabled;
         ##DeniedUrl "/RequestDenied";
         ##CheckRule "$SQL >= 8" BLOCK;
         ##CheckRule "$RFI >= 8" BLOCK;
         ##CheckRule "$TRAVERSAL >= 4" BLOCK;
         ##CheckRule "$XSS >= 8" BLOCK;
            root   html;
            index  index.html index.htm;
        }

# For Naxsi remove the ## lines for full WAF mode, redirect location block used by naxsi
        ##location /RequestDenied {
        ##    return 412;
        ##}

## Lua examples !
#         location /robots.txt {
#           rewrite_by_lua '
#             if ngx.var.http_host ~= "localhost" then
#               return ngx.exec("/robots_disallow.txt");
#             end
#           ';
#         }

        #error_page  404              /404.html;

        # redirect server error pages to the static page /50x.html
        #
        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   html;
        }

        # proxy the PHP scripts to Apache listening on 127.0.0.1:80
        #
        #location ~ \.php$ {
        #    proxy_pass   http://127.0.0.1;
        #}

        # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
        #
        #location ~ \.php$ {
        #    root           html;
        #    fastcgi_pass   127.0.0.1:9000; # single backend process
        #    fastcgi_pass   myLoadBalancer; # or multiple, see example above
        #    fastcgi_index  index.php;
        #    fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
        #    include        fastcgi_params;
        #}

        # deny access to .htaccess files, if Apache's document root
        # concurs with nginx's one
        #
        #location ~ /\.ht {
        #    deny  all;
        #}
    }

    # another virtual host using mix of IP-, name-, and port-based configuration
    #
    #server {
    #    listen       8000;
    #    listen       somename:8080;
    #    server_name  somename  alias  another.alias;

    #    location / {
    #        root   html;
    #        index  index.html index.htm;
    #    }
    #}

    # HTTPS server
    #
    #server {
    #    listen       443 ssl spdy;
    #    server_name  localhost;

    #    ssl                  on;
    #    ssl_certificate      cert.pem;
    #    ssl_certificate_key  cert.key;
    #    ssl_session_timeout  5m;
    #    ssl_prefer_server_ciphers On;
    #    ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
    #    ssl_ciphers ECDH+AESGCM:ECDH+AES256:ECDH+AES128:ECDH+3DES:RSA+AESGCM:RSA+AES:RSA+3DES:!aNULL:!eNULL:!MD5:!DSS:!EXP:!ADH:!LOW:!MEDIUM;

    #    location / {
    #        root   html;
    #        index  index.html index.htm;
    #    }
    #}

}

4. 启动服务器
进入windows的cmd; 
> cd nginx-1.7.11.3-Gryphon
> nginx.exe -c conf\nginx-win-rtmp.conf

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

windows下搭建基于nginx的rtmp服务器 的相关文章

  • 我如何移动粘性/捕捉 wpf 窗口

    当我移动 主 窗口时 我想移动两个或更多粘性窗口 我想做这样的事情 private void MainWindow PreviewMouseMove object sender MouseEventArgs e if e LeftButto
  • Windows平台下C语言控制串口DTR和RTS引脚

    如何在windows平台上控制串口的DTR和RTS引脚 我希望通过升高或降低电压来对其进行位敲击或操作 您需要使用EscapeComm 函数 https learn microsoft com en us windows desktop a
  • 在 wampserver 2.2 上安装 php_imagick.dll PHP 扩展

    我使用的是 32 位操作系统的 Windows 7 我安装了 ImageMagick 6 8 7 Q16Link https www imagemagick org script download php windows我能够从命令行 转换
  • 使用 mingw32 在 Windows 上构建 glew 时“DllMainCRTStartup@12”的多个定义

    我关注了这个主题 使用 mingw 使建筑物在 Windows 上闪闪发光 https stackoverflow com questions 6005076 building glew on windows with mingw 6005
  • subprocess.Popen('start') 失败

    在 python 中运行此命令将导致 WindowsError 指出找不到指定的文件 FAILS import subprocess subprocess Popen start notepad exe 在命令窗口中 它可以工作 start
  • 使用 Nginx 在 Docker 容器内部署带有路由器的 Angular2

    我正在尝试部署一个使用框架的路由器功能的 Angular 2 但在 docker 容器内使用 nginx 为其提供服务时遇到一些问题 由 angular cli 构建的 Angular 应用程序具有如下文件结构 dist 08c42df75
  • 如何在子 shell 中运行 cmd.exe 批处理文件

    我有一个批处理文件 通常像这样调用 longjob cmd gt result txt 2 gt 1 这工作正常 但脚本在执行过程中更改了目录 将我的 shell 留在该目录中 这很麻烦 有没有办法在子 shell 中运行命令 同时仍然允许
  • 如何使用gunicorn和bokeh服务配置Nginx

    我想提供一个 Flask 应用程序 该应用程序使用本地网络服务器上的嵌入式散景服务 为了说明这一点 我使用了一个例子散景服务示例 https github com bokeh bokeh blob 0 12 11 examples howt
  • 在 docker 中将 pgadmin 连接到 postgres

    我有一个docker compose与服务文件python nginx postgres and pgadmin services postgres image postgres 9 6 env file env volumes postg
  • Django + nginx + uwsgi 无法登录

    我有非常简单的登录逻辑 类似于官方 Django 解决方案 class Login FormView template name login html form class AuthenticationForm def get self a
  • 如何使用 PowerShell 扩展 ZIP 存档(UTF-8 文件名)

    我的 zip 存档有一个文件 P re No l txt 该 zip 可以通过 Windows 文件资源管理器 7 Zip 或我尝试过的任何其他工具很好地扩展 但我不知道如何从 PowerShell 中做到这一点 显然我已经尝试过展开 存档
  • 无法启动 Windows 服务,错误 1064

    我编写了一个在 Win10 上运行的 Windows 服务 它运行得非常好 直到我决定对其进行一些更改 我重写了一些逻辑 在调试和发布配置中进行了测试 一切都很好 然后 我使用卸载了当前版本的服务installutil exe u serv
  • nginx 上的多个网站和可用网站

    通过 nginx 的基本安装 您的sites available文件夹只有一个文件 default 怎么样sites available文件夹的工作原理以及如何使用它来托管多个 单独的 网站 只是为了添加另一种方法 您可以为您托管的每个虚拟
  • 在 Windows 7 上的 Sourcetree 中比较 Word docx 文件

    我一直在尝试获取在 Windows 7 上的 Sourcetree 中工作的 Word docx 文件的文本差异 我已按照此处的说明进行操作将 Microsoft Word 与 git 结合使用 http blog martinfenner
  • 连接被拒绝:当uwsgi和nginx在不同容器中时

    我正在尝试设置两个 docker 容器 是的 无需 docker compose 分开 一个带有 nginx 另一个带有带有基本 Flask 应用程序的 uwsgi 我在 docker 内的同一网络中运行容器我的 nginx 配置已添加 链
  • 无法加载 JNI 共享库 (JDK)

    当我尝试打开时Eclipse http www eclipse org 弹出对话框指出 无法加载 JNI 共享库 C JDK bin client jvm dll 此后 Eclipse 强制关闭 我想提出以下几点 我检查了这条路径上是否存在
  • Windows批处理文件:将结构转换为单行字符串

    我需要将这个艰巨的任务作为批处理文件来完成 这对于 C 来说不是最困难的 但在 DOS 中是一个地狱 至少对我来说 我需要将结构转换为单个 var 字符串 才能在我的程序中再次将它们转换为该结构 别担心回归 一切都已经完成了 该结构的大小会
  • 如何使用 Win32 API 与 com 端口 (RS232) 通信

    我正在尝试使用 win32 API 与 com 端口对话 我找到了这个http www robbayer com files serial win pdf http www robbayer com files serial win pdf
  • Nginx docker容器代理传递到另一个端口

    我想在 docker 容器中运行 Nginx 它监听端口 80 并且当 url 以 word 开头时 我希望它 proxy pass 到端口 8080api 我有一些网络应用程序侦听端口 8080 这在没有 docker 的情况下对我来说一
  • Python3 在 DirectX 游戏中移动鼠标

    我正在尝试构建一个在 DirectX 游戏中执行一些操作的脚本 除了移动鼠标之外 我一切都正常 是否有任何可用的模块可以移动鼠标 适用于 Windows python 3 Thanks I used pynput https pypi or

随机推荐