Advertisement
Guest User

Nginx Rtmp to Hls

a guest
Mar 4th, 2016
1,826
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.81 KB | None | 0 0
  1.  
  2. #user nobody;
  3. worker_processes 1;
  4.  
  5. #error_log logs/error.log;
  6. #error_log logs/error.log notice;
  7. #error_log logs/error.log info;
  8.  
  9. #pid logs/nginx.pid;
  10.  
  11.  
  12. events {
  13. worker_connections 1024;
  14. }
  15.  
  16.  
  17. http {
  18. include mime.types;
  19. default_type application/octet-stream;
  20.  
  21. #log_format main '$remote_addr - $remote_user [$time_local] "$request" '
  22. # '$status $body_bytes_sent "$http_referer" '
  23. # '"$http_user_agent" "$http_x_forwarded_for"';
  24.  
  25. #access_log logs/access.log main;
  26.  
  27. sendfile on;
  28. #tcp_nopush on;
  29.  
  30. #keepalive_timeout 0;
  31. keepalive_timeout 65;
  32.  
  33. #gzip on;
  34.  
  35. server {
  36. listen 8080;
  37. server_name localhost;
  38.  
  39. #charset koi8-r;
  40.  
  41. #access_log logs/host.access.log main;
  42.  
  43. location / {
  44. root html;
  45. index index.html index.htm;
  46. }
  47.  
  48.  
  49. location /hls {
  50. # Serve HLS fragments
  51. types {
  52. application/vnd.apple.mpegurl m3u8;
  53. video/mp2t ts;
  54. }
  55. root /tmp;
  56. add_header Cache-Control no-cache;
  57. add_header Access-Control-Allow-Origin *;
  58.  
  59. }
  60.  
  61. error_page 500 502 503 504 /50x.html;
  62. location = /50x.html {
  63. root html;
  64. }
  65. }
  66.  
  67. }
  68.  
  69. rtmp {
  70.  
  71. server {
  72.  
  73. listen 1935;
  74. chunk_size 8192;
  75. ping 30s;
  76. notify_method get;
  77. allow play all;
  78.  
  79. application hls {
  80. allow play all;
  81. live on;
  82. hls on;
  83. hls_path /tmp/hls;
  84. }
  85.  
  86. # MPEG-DASH is similar to HLS
  87.  
  88. #application dash {
  89. # live on;
  90. # dash on;
  91. # dash_path /tmp/dash;
  92. #}
  93. }
  94. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement