Skip to content

Commit

Permalink
Merge pull request #202 from kaltura/1.0.0-Nginx-Support-HDS
Browse files Browse the repository at this point in the history
Nginx configuration fix
  • Loading branch information
gadyaari authored Jun 20, 2016
2 parents 5d4843f + b0ced7a commit 34ed046
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 231 deletions.
202 changes: 0 additions & 202 deletions lib/manifest/ChunklistManifestGenerator.js

This file was deleted.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"forever": "0.15.1",
"glob": "5.0.14",
"heapdump": "^0.3.7",
"log4js": "0.6.29",
"m3u8": "git://github.com/eladBenedict/node-m3u8.git#master",
"mkdirp": "0.5.1",
"nconf": "0.7.2",
Expand All @@ -32,7 +33,6 @@
"shelljs": "0.5.3",
"touch": "1.0.0",
"underscore": "1.8.3",
"log4js" : "0.6.29",
"v8-profiler" : "5.5.0"
"v8-profiler": "5.5.0"
}
}
80 changes: 53 additions & 27 deletions packager/config/nginx.conf.template
Original file line number Diff line number Diff line change
Expand Up @@ -43,42 +43,68 @@ http {
#rewrite_log on;
#error_log /usr/local/nginx/logs/example.com.error.log debug;

rewrite /kLive\/smil:(.*)_all.smil\/(.*)\/chunklist.m3u8 /hls/$1/playlist.json/index-s$2.m3u8 last;
rewrite /kLive\/smil:(.*)_all.smil\/(.*)\/(.*).ts /hls/$1/playlist.json/$3.ts last;
#HLS

rewrite /kLive\/smil:(.*)_all.smil\/playlist.m3u8 /hls/$1/playlist.json/master.m3u8 last;
rewrite /kLive\/smil:(.*)_all.smil\/(.*) /hls/$1/playlist.json/$2 last;
#Rules for requesting playlist from packager
rewrite /kLive\/smil:(.*)_all.smil\/playlist.m3u8 /hls/$1/playlist.json/master.m3u8 last;
rewrite /kLive\/smil:(.*)_all.smil\/([^\/]*(:?ts|m3u8).*) /hls/$1/playlist.json/$2 last;

#Rules if backend builds playlist
rewrite /kLive\/smil:(.*)_all.smil\/(.*)\/chunklist.m3u8 /hls/$1/playlist.json/index-s$2-v1-a1.m3u8 last;
rewrite /kLive\/smil:(.*)_all.smil\/(.*)\/(.*)(.ts|.m3u8) /hls/$1/playlist.json/$3$4 last;

#HDS
rewrite /kLive\/smil:(.*)_all.smil\/manifest.f4m /hds/$1/playlist.json/manifest.f4m last;
rewrite /kLive\/smil:(.*)_all.smil\/(.*).abst /hds/$1/playlist.json/$2.abst last;

location = /serverip {

expires 1d;
return 200 "Kaltura";
}

location /hls/ {
vod hls;
alias @CONTENT_DIR@;
vod_max_mapping_response_size 1000K;
vod_align_segments_to_key_frames on;
vod_mode mapped;
vod_hls_absolute_master_urls off;
vod_hls_absolute_index_urls off;
gzip on;
gzip_types application/vnd.apple.mpegurl;
expires off;
vod_live_window_duration 0;
vod_last_modified 'Sun, 19 Nov 2000 08:52:00 GMT';
vod_last_modified_types *;
vod_expires 100d;
vod_expires_live 3;
add_header 'Access-Control-Allow-Headers' 'Origin,Range';
add_header 'Access-Control-Expose-Headers' 'Server,Content-Length,Content-Range,Date';
add_header 'Access-Control-Allow-Methods' 'GET, HEAD, OPTIONS';
add_header 'Access-Control-Allow-Origin' '*';
}


location /hls/ {
vod hls;
alias @CONTENT_DIR@;
vod_max_mapping_response_size 1000K;
vod_align_segments_to_key_frames on;
vod_mode mapped;
vod_hls_absolute_master_urls off;
vod_hls_absolute_index_urls off;
gzip on;
gzip_types application/vnd.apple.mpegurl;
expires off;
vod_live_window_duration 0;
vod_last_modified 'Sun, 19 Nov 2000 08:52:00 GMT';
vod_last_modified_types *;
vod_expires 100d;
vod_expires_live 3;
add_header 'Access-Control-Allow-Headers' 'Origin,Range';
add_header 'Access-Control-Expose-Headers' 'Server,Content-Length,Content-Range,Date';
add_header 'Access-Control-Allow-Methods' 'GET, HEAD, OPTIONS';
add_header 'Access-Control-Allow-Origin' '*';
}

location /hds/ {
vod hds;
alias @CONTENT_DIR@;
vod_max_mapping_response_size 1000K;
vod_align_segments_to_key_frames on;
vod_mode mapped;
gzip on;
gzip_types application/vnd.apple.mpegurl;
expires off;
vod_hds_manifest_file_name_prefix manifest;
vod_hds_fragment_file_name_prefix frag;
vod_last_modified 'Sun, 19 Nov 2000 08:52:00 GMT';
vod_last_modified_types *;
vod_expires 100d;
vod_expires_live 3;
add_header 'Access-Control-Allow-Headers' 'Origin,Range';
add_header 'Access-Control-Expose-Headers' 'Server,Content-Length,Content-Range,Date';
add_header 'Access-Control-Allow-Methods' 'GET, HEAD, OPTIONS';
add_header 'Access-Control-Allow-Origin' '*';
}

location / {
expires 1d;
Expand Down

0 comments on commit 34ed046

Please sign in to comment.