Advertisement
Guest User

Untitled

a guest
Mar 3rd, 2015
366
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.47 KB | None | 0 0
  1. user www www;
  2.  
  3. worker_processes 1;
  4.  
  5. error_log /home/wwwlogs/nginx_error.log crit;
  6.  
  7. pid /usr/local/nginx/logs/nginx.pid;
  8.  
  9. #Specifies the value for maximum file descriptors that can be opened by this process.
  10. worker_rlimit_nofile 51200;
  11.  
  12. events
  13. {
  14. use epoll;
  15. worker_connections 51200;
  16. }
  17.  
  18. http
  19. {
  20. include mime.types;
  21. default_type application/octet-stream;
  22.  
  23. server_names_hash_bucket_size 128;
  24. client_header_buffer_size 32k;
  25. large_client_header_buffers 4 32k;
  26. client_max_body_size 50m;
  27.  
  28. sendfile on;
  29. tcp_nopush on;
  30.  
  31. tcp_nodelay on;
  32. fastcgi_connect_timeout 300;
  33. fastcgi_send_timeout 300;
  34. fastcgi_read_timeout 300;
  35. fastcgi_buffer_size 64k;
  36. fastcgi_buffers 4 64k;
  37. fastcgi_busy_buffers_size 128k;
  38. fastcgi_temp_file_write_size 256k;
  39.  
  40. gzip on;
  41. gzip_min_length 1k;
  42. gzip_buffers 4 16k;
  43. gzip_http_version 1.0;
  44. gzip_comp_level 2;
  45. gzip_types text/plain application/x-javascript text/css application/xml;
  46. gzip_vary on;
  47.  
  48. #limit_zone crawler $binary_remote_addr 10m;
  49.  
  50. #log format
  51. log_format access '$remote_addr - $remote_user [$time_local] "$request" '
  52. '$status $body_bytes_sent "$http_referer" '
  53. '"$http_user_agent" $http_x_forwarded_for';
  54.  
  55. server
  56. {
  57. listen 80;
  58. server_name localhost;
  59. index index.html index.htm index.php;
  60. root /home/wwwroot;
  61. location ~ .*\.(php|php5)?$
  62. {
  63. try_files $uri =404;
  64. fastcgi_pass unix:/tmp/php-cgi.sock;
  65. fastcgi_index index.php;
  66. include fastcgi_params;
  67. include fcgi.conf;
  68.  
  69. }
  70.  
  71. location /test {
  72. root /home/wwwroot;
  73. # set connection secure link
  74.  
  75.  
  76. # bad hash
  77. if ($secure_link = "") {
  78. return 501;
  79. }
  80.  
  81. # link expired
  82. if ($secure_link = "0") {
  83. return 502;
  84. }
  85. if ($arg_pageUrl ~* localhost) {
  86. return 200;
  87. }
  88. return 500;
  89. }
  90.  
  91. location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
  92. {
  93. expires 10d;
  94. }
  95.  
  96. location ~ .*\.(js|css)?$
  97. {
  98. expires 12h;
  99. }
  100.  
  101.  
  102. access_log /home/wwwlogs/access.log access;
  103.  
  104.  
  105.  
  106. # This URL provides RTMP statistics in XML
  107. location /stat {
  108. rtmp_stat all;
  109. # Use this stylesheet to view XML as web page
  110. # in browser
  111. rtmp_stat_stylesheet stat.xsl;
  112. allow 127.0.0.1;
  113. }
  114.  
  115. location /stat.xsl {
  116. # XML stylesheet to view RTMP stats.
  117. # Copy stat.xsl wherever you want
  118. # and put the full directory path here
  119. root /home/wwwroot;
  120. }
  121.  
  122. location /nclients {
  123. proxy_pass http://127.0.0.1/stat;
  124. xslt_stylesheet /home/wwwroot/nclients.xsl app='$arg_app' name='$arg_name';
  125. add_header Refresh "3; $request_uri";
  126. }
  127.  
  128. location /local_redirect {
  129. rewrite ^.*$ newname? permanent;
  130. }
  131. location /remote_redirect {
  132. # no domain name here, only ip
  133. rewrite ^.*$ rtmp://192.168.0.1/someapp/somename? permanent;
  134. }
  135. # rtmp control
  136. location /control {
  137. rtmp_control all;
  138. }
  139.  
  140. location /hls {
  141. # Serve HLS fragments
  142. # alias /tmp/app;
  143. types {
  144. application/x-mpegURL.m3u8;
  145. video/MP2T.ts;
  146. }
  147. add_header Cache-Control no-cache;
  148. alias /home/wwwroot/video;
  149. # To avoid issues with cross-domain HTTP requests (e.g. during development)
  150. add_header Access-Control-Allow-Origin *;
  151. expires -1;
  152. }
  153. types {
  154. application/vnd.apple.mpegurl m3u8;
  155. video/mp2t ts;
  156. }
  157.  
  158. access_log /home/wwwlogs/access.log access;
  159. }
  160. include vhost/*.conf;
  161. }
  162. rtmp {
  163.  
  164. server {
  165.  
  166. listen 1935;
  167. chunk_size 4096;
  168.  
  169. application live {
  170. live on;
  171. exec_pull ffmpeg -re -y -i rtmp://stream_site/live82/viasat2 -vcodec copy -b:v 500k -r 30 -s 854x480 -aspect 16:9 -r 30000/1001 -ab 32k -acodec libmp3lame -ac 2 -ar 44100 -f flv rtmp://localhost:1935/test/paki;
  172.  
  173. }
  174. application test {
  175. live on;
  176. on_play http://localhost/auth.php;
  177. notify_method get;
  178.  
  179. }
  180.  
  181. }
  182.  
  183. }
  184. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement