Guest User

nginx.conf

a guest
Feb 11th, 2018
888
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.46 KB | None | 0 0
  1. #user nobody;
  2. worker_processes 1;
  3.  
  4. events {
  5. worker_connections 1024;
  6. }
  7.  
  8. rtmp {
  9. server {
  10. listen 1935;
  11. chunk_size 4096;
  12.  
  13. application hls {
  14. # Application for writing HLS chunks to /var/www/hls/
  15. live on;
  16. hls on;
  17. hls_path /var/www/hls;
  18. hls_nested on;
  19. hls_playlist_length 10m; # 10 minutes takes about 300 MB.
  20. hls_type live;
  21.  
  22. pull rtmp://IPDUSERVEUR/hls/live_low name=live_low static;
  23. pull rtmp://IPDUSERVEUR/hls/live_mid name=live_mid static;
  24. pull rtmp://IPDUSERVEUR/hls/live_hi name=live_hi static;
  25.  
  26. hls_variant _low BANDWIDTH=512000;
  27. hls_variant _mid BANDWIDTH=1024000;
  28. hls_variant _hi BANDWIDTH=2048000;
  29.  
  30. # maximum allowed connections
  31. # warning: the true limit shall be done at the http level,
  32. # this is for RTMP clients only
  33.  
  34. # max_connections 512;
  35.  
  36. # allow local publish only
  37. allow publish 127.0.0.1;
  38. deny publish all;
  39.  
  40. # allow all RTMP clients
  41. allow play all;
  42. #deny play all;
  43. }
  44. }
  45. }
  46.  
  47. # HTTP can be used for accessing RTMP stats
  48. http {
  49. include mime.types;
  50. default_type application/octet-stream;
  51.  
  52. sendfile on;
  53. keepalive_timeout 65;
  54. #gzip on;
  55.  
  56. server {
  57. listen 80;
  58. server_name localhost;
  59.  
  60. # This URL provides RTMP statistics in XML
  61. location /stat {
  62. rtmp_stat all;
  63. # Use this stylesheet to view XML as web page
  64. # in browser
  65. rtmp_stat_stylesheet stat.xsl;
  66. }
  67.  
  68. location /stat.xsl {
  69. # XML stylesheet to view RTMP stats.
  70. # Copy stat.xsl wherever you want
  71. # and put the full directory path here
  72. root /var/www/stat/;
  73. }
  74.  
  75. location /hls {
  76. # Serve HLS fragments
  77. types {
  78. application/vnd.apple.mpegurl m3u8;
  79. video/mp2t ts;
  80. }
  81. root /var/www;
  82. add_header Cache-Control no-cache;
  83. add_header 'Access-Control-Allow-Origin' "$http_origin";
  84. }
  85.  
  86. location / {
  87. root /var/www/player;
  88. add_header Cache-Control no-cache;
  89. }
  90.  
  91. # redirect server error pages to the static page /50x.html
  92. error_page 500 502 503 504 /50x.html;
  93. location = /50x.html {
  94. root html;
  95. }
  96. }
  97. }
Advertisement
Add Comment
Please, Sign In to add comment