Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. #user  nobody;
  2. worker_processes auto;
  3.  
  4. #error_log  logs/error.log;
  5. #error_log  logs/error.log  notice;
  6. #error_log  logs/error.log  info;
  7.  
  8. #pid        logs/nginx.pid;
  9.  
  10.  
  11. events {
  12.     worker_connections  1024;
  13. }
  14.  
  15.  
  16. http {
  17.     include       mime.types;
  18.     sendfile off;
  19.     tcp_nopush on;
  20.     #aio on;
  21.     directio 512;
  22.     default_type application/octet-stream;
  23.    
  24.     server {
  25.         listen       80;
  26.         server_name  localhost mondomaine.fr;
  27.  
  28.         #charset koi8-r;
  29.  
  30.         #access_log  logs/host.access.log  main;
  31.  
  32.         location / {
  33.             root   html;
  34.             index  index.html index.htm;
  35.         }
  36.  
  37.         #error_page  404              /404.html;
  38.  
  39.         # redirect server error pages to the static page /50x.html
  40.         #
  41.         error_page   500 502 503 504  /50x.html;
  42.         location = /50x.html {
  43.             root   html;
  44.         }
  45.  
  46.         # proxy the PHP scripts to Apache listening on 127.0.0.1:80
  47.         #
  48.         #location ~ \.php$ {
  49.         #    proxy_pass   http://127.0.0.1;
  50.         #}
  51.  
  52.         # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
  53.         #
  54.         #location ~ \.php$ {
  55.         #    root           html;
  56.         #    fastcgi_pass   127.0.0.1:9000;
  57.         #    fastcgi_index  index.php;
  58.         #    fastcgi_param  SCRIPT_FILENAME  /scripts$fastcgi_script_name;
  59.         #    include        fastcgi_params;
  60.         #}
  61.  
  62.         # deny access to .htaccess files, if Apache's document root
  63.         # concurs with nginx's one
  64.         #
  65.         #location ~ /\.ht {
  66.         #    deny  all;
  67.         #}
  68.     }
  69.  
  70.     server {
  71.         listen 8080;
  72.         server_name localhost mondomaine.fr;
  73.  
  74.         location / {
  75.             add_header 'Cache-Control' 'no-cache';
  76.             add_header 'Access-Control-Allow-Origin' '*' always;
  77.             add_header 'Access-Control-Expose-Headers' 'Content-Length,Content-Range';
  78.             add_header 'Access-Control-Allow-Headers' 'Range';
  79.             if ($request_method = 'OPTIONS') {
  80.                 add_header 'Access-Control-Allow-Origin' '*';
  81.                 add_header 'Access-Control-Allow-Headers' 'Range';
  82.                 add_header 'Access-Control-Max-Age' 1728000;
  83.                 add_header 'Content-Type' 'text/plain charset=UTF-8';
  84.                 add_header 'Content-Length' 0;
  85.                 return 204;
  86.             }
  87.             types {
  88.                 application/dash+xml mpd;
  89.                 application/vnd.apple.mpegurl m3u8;
  90.                 video/mp2t ts;
  91.             }
  92.             root /var/lib/streaming/;
  93.         }
  94.  
  95.     }
  96.  
  97. }
  98.  
  99. rtmp {
  100.     server {
  101.         listen 1935;
  102.         chunk_size 4000;
  103.         application live {
  104.             live on;
  105.             hls on;
  106.             hls_path /var/lib/streaming/hls/;
  107.             hls_fragment 3s;
  108.             hls_playlist_length 60s;
  109.             deny play all;
  110.         }
  111.     }
  112. }