Skip to content

Instantly share code, notes, and snippets.

@dunkelstern
Created September 21, 2016 12:33
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dunkelstern/432af3e1d8fa04ebc83f61b7c8587548 to your computer and use it in GitHub Desktop.
Save dunkelstern/432af3e1d8fa04ebc83f61b7c8587548 to your computer and use it in GitHub Desktop.
nginx RTMP config
user rtmp;
worker_processes 1;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
gzip on;
server {
listen 8080;
server_name streaming.example.com;
location /stat {
rtmp_stat all;
rtmp_stat_stylesheet /style.xsl;
}
location /live {
types {
application/vnd.apple.mpegurl m3u8;
video/mp2t ts;
}
alias /srv/stream/media/hls;
add_header Cache-Control no-cache;
}
location /vod {
types {
application/vnd.apple.mpegurl m3u8;
video/mp2t ts;
}
alias /srv/stream/media/hls-vod;
add_header Cache-Control no-cache;
}
location /control {
rtmp_control all;
}
location / {
types {
application/xslt+xml xsl;
}
root /srv/stream/html;
index index.html index.htm;
}
}
}
rtmp {
server {
listen 1935;
chunk_size 4000;
application live {
live on;
recorder rec {
record all manual;
record_suffix .flv;
record_path /srv/stream/media;
record_unique on;
}
allow publish all;
allow play all;
hls on;
hls_path /srv/stream/media/hls;
}
application vod {
play /srv/stream/media;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment