Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- user root;
- #Root is only OK if the server is not public. Otherwise you need to increase security on your own.
- # user www-data;
- #use up to 4 processes if you expect allot of traffic. But this causes issues with rtmp /stat page and possibly pushing/pulling
- #worker_processes 4;
- worker_processes 1;
- events {
- worker_connections 1024;
- }
- http {
- include /etc/nginx/mime.types;
- default_type application/octet-stream;
- sendfile on;
- keepalive_timeout 65;
- #if you want gzip enabled
- #gzip on;
- #gzip_disable "msie6";
- server {
- listen 80;
- server_name localhost;
- # rtmp stat
- location /stat {
- rtmp_stat all;
- rtmp_stat_stylesheet stat.xsl;
- }
- location /stat.xsl {
- # you can move stat.xsl to a different location
- root /usr/src/nginx-rtmp-module;
- }
- # rtmp control
- location /control {
- rtmp_control all;
- }
- error_page 500 502 503 504 /50x.html;
- location = /50x.html {
- root html;
- }
- # Client (VLC etc.) can access HLS here.
- location /hls {
- # Serve HLS fragments
- types {
- application/vnd.apple.mpegurl m3u8;
- video/mp2t ts;
- }
- root /tmp;
- add_header Cache-Control no-cache;
- }
- }
- }
- rtmp {
- server {
- listen 12345;
- chunk_size 8192;
- ping 30s;
- notify_method get;
- allow play all;
- # You should send x.264/aac RTMP Stream via ffmpeg to this application
- application hls {
- allow play all;
- live on;
- hls on;
- hls_path /tmp/hls;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement