Skip to content

Instantly share code, notes, and snippets.

@nucleare
Forked from pschichtel/nginx_rtmp.conf
Last active January 1, 2021 15:34
Show Gist options
  • Save nucleare/9592ad7c2571613dbf54c151569d1ba2 to your computer and use it in GitHub Desktop.
Save nucleare/9592ad7c2571613dbf54c151569d1ba2 to your computer and use it in GitHub Desktop.
A nginx configuration adding an RTMP server for collection of multiple streams from the local network It will be modified to add a number of other features in due time and was forked for preservation.
rtmp {
server {
listen 0.0.0.0:1935;
chunk_size 4096;
# The collection server, streaming allowed from standard local /16 subnets
# Stream to rtmp://<server ip>/collect/<stream key>
# Playing is allowed from all addresses using the same rtmp URL
application collect {
live on;
record off;
allow publish 127.0.0.0/16;
allow publish 192.168.0.0/16;
allow publish 10.0.0.0/16;
allow publish 172.16.0.0/16;
deny publish all;
allow play all;
# can be used to directly bridge a single stream from the collection to the publishing server
#push "rtmp://localhost/publish/bridge";
}
# Publishing server that will publish to streaming site (e.g. twitch) and/or record to disk
# Streaming to this application is only allowed from local addresses
application publish {
live on;
record off;
allow publish 127.0.0.0/16;
deny publish all;
allow play all;
push "rtmp://live-fra.twitch.tv/app/<stream key>";
}
}
}
@nucleare
Copy link
Author

nucleare commented Jan 1, 2021

In it's current state, it helps act as a base to other functions hoping to be achieved and will be modified in due time

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment