我的NGINX使用简介

先上配置:

work_processes4;
events{
    work_connections1024;
}

http{
    include mime.types;
    default_type application/octet-stream;
    sendfileon;
    keepalive_timeout65;
    server{
        listen80;
        server_name localhost;
        location /{
            root html;
            insex index.html index.htm;
            }
        location /hls{
            alias /tmp/app;
            }
        error_page500502503504 /50x.html;
        location = /50x.html{
            root html;
            }
        }
    }

rtmp{
    server{
        listen1935;
        chunk_size4000;
        application liaortmp{
            liveon;
            }
        application hls{
            liveon;
            hlson;
            hls_path /tmp/app;
            hls_frament15s;
            }
        }
    }
登录后复制

配置的解读


  • workprocesses和work_connections

  • http server的配置

  • rtmp推流服务器的配置
  • 至此nginx的简单配置已经完成,/usr/local/conf/nginx.conf里面储存的就是上面的配置。


    • 举个列子(关于app

    参考
    1. Nginx配置文件详细说明
    2. Nginx RTMP 模块 nginx-rtmp-module 指令详解

    以上就介绍了NGINX配置rtmp服务器实现rtmp以及hls直播,包括了方面的内容,希望对PHP教程有兴趣的朋友有所帮助。

    09-06 09:39