nginx用作视频直播服务器的配置文件

Tue 23 September 2025

将下列内容添加到 /usr/local/nginx/conf/nginx.conf 文件中相应位置。

rtmp {
    server {
        listen 1935;

        application app{
            live on;
        hls on;
            hls_path /usr/local/nginx/html/hls;
        }
    }
}

启动 nginx

/usr/local/nginx/sbin/nginx

重启 nginx

/usr/local/nginx/sbin/nginx -s reload

推流地址:

rtmp://IP地址:1935/app/

推流密钥:

任意填写

流媒体播放地址:

rtmp://IP地址:1935/app/推流密钥

Category: 待整理