ustoopia

nginx.conf

Jul 16th, 2020
386
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. user www-data;
  2. worker_processes 1;
  3. pid /run/nginx.pid;
  4. include /etc/nginx/modules-enabled/*.conf;
  5.  
  6. events {
  7. worker_connections 768;
  8. # multi_accept on;
  9. }
  10.  
  11. http {
  12. sendfile on;
  13. tcp_nopush on;
  14. tcp_nodelay on;
  15. keepalive_timeout 65;
  16. types_hash_max_size 2048;
  17. # server_tokens off;
  18. # server_names_hash_bucket_size 64;
  19. # server_name_in_redirect off;
  20. include /etc/nginx/mime.types;
  21. default_type application/octet-stream;
  22.  
  23. gzip off;
  24. # gzip_vary on;
  25. # gzip_proxied any;
  26. # gzip_comp_level 6;
  27. # gzip_buffers 16 8k;
  28. # gzip_http_version 1.1;
  29. # gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;
  30.  
  31. access_log /var/log/nginx/access.log;
  32. error_log /var/log/nginx/error.log;
  33.  
  34. include /etc/nginx/conf.d/*.conf;
  35. include /etc/nginx/sites-enabled/*;
  36. }
  37.  
  38. rtmp {
  39. access_log /var/log/nginx/rtmp_access.log;
  40. server {
  41. listen 1935;
  42. chunk_size 8192;
  43.  
  44. application live {
  45. live on;
  46. meta on;
  47. record off;
  48. interleave off;
  49. wait_key on;
  50. wait_video off;
  51. idle_streams off;
  52. sync 300ms;
  53. session_relay on;
  54. max_connections 1000;
  55. allow publish all;
  56. allow play all;
  57. hls off;
  58. dash off;
  59.  
  60. # on_publish http://yourdomain.com/plugin/Live/on_publish.php;
  61. # on_play http://yourdomain/plugin/Live/on_play.php;
  62. # on_record_done http://yourdomain/plugin/Live/on_record_done.php;
  63.  
  64. push rtmp://localhost/hls;
  65. push rtmp://localhost/dash;
  66.  
  67. }
  68. application hls {
  69. live on;
  70. record off;
  71. meta copy;
  72. allow publish 127.0.0.1;
  73. allow play all;
  74.  
  75. hls on;
  76. hls_nested on;
  77. hls_cleanup on;
  78. hls_sync 100ms;
  79. hls_fragment 2s;
  80. hls_playlist_length 10s;
  81. hls_path /var/livestream/hls;
  82. }
  83. application dash {
  84. live on;
  85. record off;
  86. allow publish 127.0.0.1;
  87. deny publish all;
  88. allow play all;
  89.  
  90. dash on;
  91. dash_nested on;
  92. dash_cleanup on;
  93. dash_fragment 5s;
  94. dash_playlist_length 20s;
  95. dash_path /var/livestream/dash;
  96. }
  97. application vods {
  98. play /var/livestream/recordings;
  99. allow play all;
  100. }
  101. application vods_http {
  102. play https://yourdomain.com/recordings;
  103. allow play all;
  104. }
  105. }
  106. }
RAW Paste Data Copied