This chapter is based on the pagoda panel

Uninstall Nginx

The configurations of nginx rtmp and nginx are different, and the pagoda panel does not support the installation of nginx rtmp

Pre download Nginx

 cd /www/server git clone  https://github.com/arut/nginx-rtmp-module.git #Git error installing git: yum - y install git

Modify configuration (pay attention to format)

 vim /www/server/panel/install/nginx.sh

Add module: --add-module=/www/server/nginx-rtmp-module

Install nginx (it takes a long time to install nginx, which can be matched with screen)

 sh /www/server/panel/install/nginx.sh install 1.18

Create a website and remember the website directory

Modify Nginx configuration

Settings - configuration modification About 13 lines added

 rtmp { server { listen 6666; # The monitored port can be replaced at will. Remember the square corresponding port after replacement chunk_size 4000; application hls { live on; hls on; hls_path /www/wwwroot/xx.com/live; # Here is the path of the live folder hls_fragment 5s; } } }

Reload, restart nginx

Streaming

Streaming address: rtmp://IP:port/hls

Playback address: http://IP/live/ Streaming Key.m3u8

The streaming key is set on the streaming client, such as OBS

Firewall pass port


Reference: https://blog.csdn.net/qq_35774849/article/details/106334115

End