Use the pagoda panel to build a live broadcast system - nginx+rtmp+hls

Environment: Ubuntu 20.04.1, Pagoda Linux Panel, nginx 1.19.6

Building steps

Please install the pagoda panel by yourself

1. Compile nginx

Using rtmp requires the rtmp module of nginx, so you need to recompile nginx

1. Login panel - software store - nginx - compile and install - add custom modules


2. Enter nginx_rtmp_module for the module name and description, and fill in the parameters --add-module=/www/server/nginx/src/nginx-rtmp-module

Pre-script input:

git clone

3. Submit, select the module, submit, and wait for the compilation to complete

4. Enter nginx -V on the command line to check whether the installation is successful

2. Configure rtmp

Software store-nginx-settings-configuration modification
add rtmp configuration in it

rtmp { server { listen 1935; #rtmp listening port, default 1935 chunk_size 4096; # packet size application live { live on; hls on; hls_path /tmp/hls; # hls file (m3u8,ts) save directory hls_fragment 3s; } } }


3. Configure hls

Pagoda Panel - Website - Add Site

Fill in here according to the actual situation

After the creation is complete, go to Site Settings - Configuration File

add hls configuration

location /live { types { application/ m3u8; video/mp2t ts; } alias /tmp/hls; # is the same as the hls directory just set add_header Cache-Control no-cache; }



rtmp test

Start obs, set the streaming target, fill in the server address, and write any streaming key.

Start push

Open vlc-network streaming, enter the set rtmp address, click play to see the screen

hls test

vlc - network stream, input [http/https]://[server address]/live/[streaming key].m3u8, click play to see the screen


Reference article:

  1. JohannesYang says:
    Google Chrome Windows 7

Leave a Reply

Your Email address will not be published. The required items are marked with *