Skip to content

Instantly share code, notes, and snippets.

@pschichtel
Created October 3, 2015 15:05
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save pschichtel/31fc635174bac1bc1a7c to your computer and use it in GitHub Desktop.
Save pschichtel/31fc635174bac1bc1a7c 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
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>";
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment