Custom NGINX RTMP module auth scripts with html gui system
Requires MySQL/MariaDB, PHP, NGINX RTMP/FLV Module
{IP} is your servers IP/Domain
{port} is your rtmp module's port
{app} is the application in the RTMP section
{Key} is the live stream key from the MySQL Database
- Setup a webserver to listen on 127.0.0.1
- Edit NGINX Configuration RTMP section to contain:
rtmp {
server {
listen **{port}**;
application **{app}** {
live on;
on_publish http://**{IP}**/path/to/auth.php;
on_publish_done http://**{IP}**/path/to/deauth.php;
on_play http://**{IP}**/path/to/play.php;
}
}
}
- Import MySQL/MariaDB SQL file
- Edit the 'profile.php' to point to the proper Database information
- Edit the SQL Database or access the 'index.php' to contain information for a valid key(s) & username(s).
The 'profile.php' doesn't have any administrator auth protect. it mean anyone can edit the auth database
But you can use the nginx's auth to protect this page
- Use OpesSSL to create a nginx user password
printf "{Fill Your Username}:$(openssl passwd -apr1)" >> /path/to/nginx/conf/passwords
- Edit the nginx configure file and add auth_base to where your 'profile.php' in
location /path/to/profile/ {
auth_basic "Protected";
auth_basic_user_file passwords;
}
OBS Stream Settings
Server: rtmp://{IP}/{app}
Stream Key: {Key}
Don't check "Use Authenication"
The database should use all lower-case information and keys
URL: rtmp://{IP}/{app}/{username}
Private stream URP: rtmp://{IP}/{app}/{username}?key={private_key}