Advertisement
Guest User

Untitled

a guest
Feb 18th, 2019
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Nginx 2.62 KB | None | 0 0
  1. [root@nginxrtmp nginx]# cat nginx.conf
  2. user nginx;
  3. worker_processes  auto;
  4.  
  5. error_log /var/log/nginx/error-debug.log debug;
  6. ### error_log /var/log/nginx/error.log;
  7. pid /run/nginx.pid;
  8.  
  9. worker_rlimit_nofile 131072;
  10.  
  11. # Load dynamic modules. See /usr/share/nginx/README.dynamic.
  12. include /usr/share/nginx/modules/*.conf;
  13.  
  14. events {
  15.     worker_connections  10000;
  16. }
  17.  
  18. # Настройка RTMP модуля
  19.  
  20. rtmp_auto_push on;
  21.  
  22. rtmp {
  23.     wait_key on;
  24.     wait_video on;
  25.     publish_notify on;
  26.  
  27.     # Данные об RTMP командах
  28.     log_format  rtmpfull 'addr $remote_addr, time [$time_local], cmd $command, app "$app", name "$name", args "$args", '
  29.                           '- recieved!!! $bytes_received, sent!!! $bytes_sent, pageurl "$pageurl", flashver "$flashver", sesstimeout ($session_readable_time), '
  30.                           '- conection $connection, $msec $time_local $session_time '
  31.                           '- swfurl $swfurl, turl $tcurl';
  32.     access_log  /var/log/nginx/access.log  rtmpfull;
  33.  
  34.     # Сервер RTMP модуля
  35.     server {
  36.         listen 2019;
  37.         chunk_size 4096;
  38.    
  39.         # RTMP приложение для стрима
  40.         application stream {
  41.             live on;
  42.         }
  43.  
  44.     }
  45.  
  46. }
  47.  
  48. http {
  49.  
  50.     log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
  51.                       '$status $body_bytes_sent "$http_referer" '
  52.                       '"$http_user_agent" "$http_x_forwarded_for"';
  53.  
  54.     access_log  /var/log/nginx/access.log  main buffer=16k;
  55.  
  56.     sendfile off;
  57.     tcp_nopush on;
  58.     aio on;
  59.     directio 512;
  60.     default_type application/octet-stream;
  61.  
  62.     types_hash_max_size 2048;
  63.  
  64.     server_names_hash_bucket_size 128;
  65.  
  66.  
  67.     server {
  68.         listen 8088;
  69.  
  70.         location / {
  71.             # Disable cache
  72.             add_header 'Cache-Control' 'no-cache';
  73.  
  74.             # CORS setup
  75.             add_header 'Access-Control-Allow-Origin' '*' always;
  76.             add_header 'Access-Control-Expose-Headers' 'Content-Length';
  77.  
  78.             # allow CORS preflight requests
  79.             if ($request_method = 'OPTIONS') {
  80.                 add_header 'Access-Control-Allow-Origin' '*';
  81.                 add_header 'Access-Control-Max-Age' 1728000;
  82.                 add_header 'Content-Type' 'text/plain charset=UTF-8';
  83.                 add_header 'Content-Length' 0;
  84.                 return 204;
  85.             }
  86.  
  87.             types {
  88.                 application/dash+xml mpd;
  89.                 application/vnd.apple.mpegurl m3u8;
  90.                 video/mp2t ts;
  91.             }
  92.  
  93.             root /mnt/;
  94.         }
  95.     }
  96. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement