Advertisement
Guest User

nginx HLS config

a guest
Dec 11th, 2013
13,099
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.74 KB | None | 0 0
  1. user root;
  2. #Root is only OK if the server is not public. Otherwise you need to increase security on your own.
  3. # user www-data;
  4. #use up to 4 processes if you expect allot of traffic. But this causes issues with rtmp /stat page and possibly pushing/pulling
  5. #worker_processes 4;
  6. worker_processes 1;
  7.  
  8. events {
  9. worker_connections 1024;
  10. }
  11.  
  12. http {
  13. include /etc/nginx/mime.types;
  14. default_type application/octet-stream;
  15. sendfile on;
  16. keepalive_timeout 65;
  17. #if you want gzip enabled
  18. #gzip on;
  19. #gzip_disable "msie6";
  20.  
  21. server {
  22. listen 80;
  23. server_name localhost;
  24.  
  25. # rtmp stat
  26. location /stat {
  27. rtmp_stat all;
  28. rtmp_stat_stylesheet stat.xsl;
  29. }
  30.  
  31. location /stat.xsl {
  32. # you can move stat.xsl to a different location
  33. root /usr/src/nginx-rtmp-module;
  34. }
  35.  
  36. # rtmp control
  37. location /control {
  38. rtmp_control all;
  39. }
  40. error_page 500 502 503 504 /50x.html;
  41. location = /50x.html {
  42. root html;
  43. }
  44.  
  45. # Client (VLC etc.) can access HLS here.
  46. location /hls {
  47. # Serve HLS fragments
  48. types {
  49. application/vnd.apple.mpegurl m3u8;
  50. video/mp2t ts;
  51. }
  52. root /tmp;
  53. add_header Cache-Control no-cache;
  54. }
  55. }
  56. }
  57. rtmp {
  58. server {
  59. listen 12345;
  60. chunk_size 8192;
  61. ping 30s;
  62. notify_method get;
  63. allow play all;
  64.  
  65. # You should send x.264/aac RTMP Stream via ffmpeg to this application
  66. application hls {
  67. allow play all;
  68. live on;
  69. hls on;
  70. hls_path /tmp/hls;
  71. }
  72. }
  73. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement