Advertisement
Guest User

Untitled

a guest
Apr 1st, 2015
228
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.80 KB | None | 0 0
  1. env PATH;
  2. #user nobody;
  3. worker_processes 1;
  4.  
  5. #error_log logs/error.log;
  6. #error_log logs/error.log notice;
  7. #error_log logs/error.log info;
  8.  
  9. #pid logs/nginx.pid;
  10.  
  11.  
  12. events {
  13. worker_connections 1024;
  14. }
  15.  
  16.  
  17. http {
  18. include mime.types;
  19. default_type application/octet-stream;
  20.  
  21. #log_format main '$remote_addr - $remote_user [$time_local] "$request" '
  22. # '$status $body_bytes_sent "$http_referer" '
  23. # '"$http_user_agent" "$http_x_forwarded_for"';
  24.  
  25. #access_log logs/access.log main;
  26.  
  27. sendfile on;
  28. #tcp_nopush on;
  29.  
  30. #keepalive_timeout 0;
  31. keepalive_timeout 65;
  32.  
  33. #gzip on;
  34.  
  35. server {
  36. listen 80;
  37. server_name localhost;
  38.  
  39. #charset koi8-r;
  40.  
  41. #access_log logs/host.access.log main;
  42.  
  43. location /apt {
  44. autoindex on;
  45. }
  46. location / {
  47. root html;
  48. index index.html index.htm;
  49. }
  50.  
  51. #error_page 404 /404.html;
  52.  
  53. # redirect server error pages to the static page /50x.html
  54. #
  55. error_page 500 502 503 504 /50x.html;
  56. location = /50x.html {
  57. root html;
  58. }
  59.  
  60. # proxy the PHP scripts to Apache listening on 127.0.0.1:80
  61. #
  62. #location ~ \.php$ {
  63. # proxy_pass http://127.0.0.1;
  64. #}
  65.  
  66. # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
  67. #
  68. #location ~ \.php$ {
  69. # root html;
  70. # fastcgi_pass 127.0.0.1:9000;
  71. # fastcgi_index index.php;
  72. # fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
  73. # include fastcgi_params;
  74. #}
  75.  
  76. # deny access to .htaccess files, if Apache's document root
  77. # concurs with nginx's one
  78. #
  79. #location ~ /\.ht {
  80. # deny all;
  81. #}
  82. # rtmp stat
  83. location /stat {
  84. rtmp_stat all;
  85. rtmp_stat_stylesheet stat.xsl;
  86. }
  87. location /stat.xsl {
  88. # you can move stat.xsl to a different location
  89. root /home/ubuntu/dev/nginx-rtmp-module;
  90. }
  91.  
  92. # rtmp control
  93. location /control {
  94. rtmp_control all;
  95. }
  96. # hls
  97. location /hls {
  98. root /tmp;
  99.  
  100. location ~* \.m3u8$ {
  101. add_header Cache-Control "max-age=2";
  102. add_header Access-Control-Allow-Origin *;
  103.  
  104. # try_files $uri @node;
  105. }
  106.  
  107. location ~* \.ts$ {
  108. add_header Cache-Control "max-age=120";
  109. add_header Access-Control-Allow-Origin *;
  110. }
  111. }
  112.  
  113. location /api {
  114. proxy_pass http://localhost:1337;
  115. }
  116.  
  117. location /sk {
  118. proxy_pass http://localhost:1339;
  119. }
  120.  
  121. location /secondscreen {
  122. proxy_pass http://localhost:1340;
  123. }
  124.  
  125. location /share {
  126. proxy_pass http://localhost:1341;
  127. }
  128.  
  129. location @node {
  130. add_header Cache-Control "max-age=2";
  131.  
  132. rewrite ^/hls/([a-zA-Z0-9]+)\.m3u8$ /recordings/play-recorded?stream_key=$1 break;
  133. proxy_pass http://localhost:1338;
  134. }
  135.  
  136. }
  137.  
  138.  
  139. # another virtual host using mix of IP-, name-, and port-based configuration
  140. #
  141. #server {
  142. # listen 8000;
  143. # listen somename:8080;
  144. # server_name somename alias another.alias;
  145.  
  146. # location / {
  147. # root html;
  148. # index index.html index.htm;
  149. # }
  150. #}
  151.  
  152.  
  153. # HTTPS server
  154. #
  155. #server {
  156. # listen 443 ssl;
  157. # server_name localhost;
  158.  
  159. # ssl_certificate cert.pem;
  160. # ssl_certificate_key cert.key;
  161.  
  162. # ssl_session_cache shared:SSL:1m;
  163. # ssl_session_timeout 5m;
  164.  
  165. # ssl_ciphers HIGH:!aNULL:!MD5;
  166. # ssl_prefer_server_ciphers on;
  167.  
  168. # location / {
  169. # root html;
  170. # index index.html index.htm;
  171. # }
  172. #}
  173.  
  174. }
  175. rtmp {
  176. server {
  177. listen 1935;
  178. ping 30s;
  179. notify_method get;
  180.  
  181. application mob {
  182. live on;
  183. idle_streams off;
  184. drop_idle_publisher 5s;
  185.  
  186. hls on;
  187. hls_path /tmp/hls;
  188. hls_sync 100ms;
  189. hls_fragment 1s;
  190.  
  191. recorder archive {
  192. record all;
  193. record_path /tmp/rec;
  194. record_unique on;
  195. }
  196. }
  197.  
  198.  
  199. # Video on demand
  200. application vod {
  201. play /home/ubuntu/dev;
  202. }
  203.  
  204. # Video on demand over HTTP
  205. #application vod_http {
  206. # play http://localhost:8080/vod/;
  207. #}
  208. }
  209. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement