Advertisement
Guest User

Untitled

a guest
Jan 21st, 2019
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.49 KB | None | 0 0
  1.  
  2. worker_processes auto;
  3. events {
  4. worker_connections 1024;
  5. }
  6.  
  7. # RTMP configuration
  8. rtmp {
  9. server {
  10. listen 1935; # Listen on standard RTMP port
  11. chunk_size 4000;
  12.  
  13. application show {
  14. live on;
  15. # Turn on HLS
  16. hls on;
  17. hls_path /mnt/hls/;
  18. hls_fragment 3;
  19. hls_playlist_length 60;
  20. # disable consuming the stream from nginx as rtmp
  21. deny play all;
  22. }
  23. }
  24. }
  25.  
  26. http {
  27. sendfile off;
  28. tcp_nopush on;
  29. directio 512;
  30. default_type application/octet-stream;
  31.  
  32. server {
  33. listen 8080;
  34.  
  35. location / {
  36. # Disable cache
  37. add_header 'Cache-Control' 'no-cache';
  38.  
  39. # CORS setup
  40. add_header 'Access-Control-Allow-Origin' '*' always;
  41. add_header 'Access-Control-Expose-Headers' 'Content-Length';
  42.  
  43. # allow CORS preflight requests
  44. if ($request_method = 'OPTIONS') {
  45. add_header 'Access-Control-Allow-Origin' '*';
  46. add_header 'Access-Control-Max-Age' 1728000;
  47. add_header 'Content-Type' 'text/plain charset=UTF-8';
  48. add_header 'Content-Length' 0;
  49. return 204;
  50. }
  51.  
  52. types {
  53. application/dash+xml mpd;
  54. application/vnd.apple.mpegurl m3u8;
  55. video/mp2t ts;
  56. }
  57.  
  58. root /mnt/;
  59. }
  60. }
  61. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement