Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- env PATH;
- #user nobody;
- worker_processes 1;
- #error_log logs/error.log;
- #error_log logs/error.log notice;
- #error_log logs/error.log info;
- #pid logs/nginx.pid;
- events {
- worker_connections 1024;
- }
- http {
- include mime.types;
- default_type application/octet-stream;
- #log_format main '$remote_addr - $remote_user [$time_local] "$request" '
- # '$status $body_bytes_sent "$http_referer" '
- # '"$http_user_agent" "$http_x_forwarded_for"';
- #access_log logs/access.log main;
- sendfile on;
- #tcp_nopush on;
- #keepalive_timeout 0;
- keepalive_timeout 65;
- #gzip on;
- server {
- listen 80;
- server_name localhost;
- #charset koi8-r;
- #access_log logs/host.access.log main;
- location /apt {
- autoindex on;
- }
- location / {
- root html;
- index index.html index.htm;
- }
- #error_page 404 /404.html;
- # redirect server error pages to the static page /50x.html
- #
- error_page 500 502 503 504 /50x.html;
- location = /50x.html {
- root html;
- }
- # proxy the PHP scripts to Apache listening on 127.0.0.1:80
- #
- #location ~ \.php$ {
- # proxy_pass http://127.0.0.1;
- #}
- # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
- #
- #location ~ \.php$ {
- # root html;
- # fastcgi_pass 127.0.0.1:9000;
- # fastcgi_index index.php;
- # fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
- # include fastcgi_params;
- #}
- # deny access to .htaccess files, if Apache's document root
- # concurs with nginx's one
- #
- #location ~ /\.ht {
- # deny all;
- #}
- # rtmp stat
- location /stat {
- rtmp_stat all;
- rtmp_stat_stylesheet stat.xsl;
- }
- location /stat.xsl {
- # you can move stat.xsl to a different location
- root /home/ubuntu/dev/nginx-rtmp-module;
- }
- # rtmp control
- location /control {
- rtmp_control all;
- }
- # hls
- location /hls {
- root /tmp;
- location ~* \.m3u8$ {
- add_header Cache-Control "max-age=2";
- add_header Access-Control-Allow-Origin *;
- # try_files $uri @node;
- }
- location ~* \.ts$ {
- add_header Cache-Control "max-age=120";
- add_header Access-Control-Allow-Origin *;
- }
- }
- location /api {
- proxy_pass http://localhost:1337;
- }
- location /sk {
- proxy_pass http://localhost:1339;
- }
- location /secondscreen {
- proxy_pass http://localhost:1340;
- }
- location /share {
- proxy_pass http://localhost:1341;
- }
- location @node {
- add_header Cache-Control "max-age=2";
- rewrite ^/hls/([a-zA-Z0-9]+)\.m3u8$ /recordings/play-recorded?stream_key=$1 break;
- proxy_pass http://localhost:1338;
- }
- }
- # another virtual host using mix of IP-, name-, and port-based configuration
- #
- #server {
- # listen 8000;
- # listen somename:8080;
- # server_name somename alias another.alias;
- # location / {
- # root html;
- # index index.html index.htm;
- # }
- #}
- # HTTPS server
- #
- #server {
- # listen 443 ssl;
- # server_name localhost;
- # ssl_certificate cert.pem;
- # ssl_certificate_key cert.key;
- # ssl_session_cache shared:SSL:1m;
- # ssl_session_timeout 5m;
- # ssl_ciphers HIGH:!aNULL:!MD5;
- # ssl_prefer_server_ciphers on;
- # location / {
- # root html;
- # index index.html index.htm;
- # }
- #}
- }
- rtmp {
- server {
- listen 1935;
- ping 30s;
- notify_method get;
- application mob {
- live on;
- idle_streams off;
- drop_idle_publisher 5s;
- hls on;
- hls_path /tmp/hls;
- hls_sync 100ms;
- hls_fragment 1s;
- recorder archive {
- record all;
- record_path /tmp/rec;
- record_unique on;
- }
- }
- # Video on demand
- application vod {
- play /home/ubuntu/dev;
- }
- # Video on demand over HTTP
- #application vod_http {
- # play http://localhost:8080/vod/;
- #}
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement