Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- server {
- listen 80;
- server_name smooth-streaming.example.org
- # document root...
- root "/var/www/smooth";
- # turn off ngx_mod_smooth_streaming built-in
- # rewrite engine (requires patch)
- # patch URL: https://gist.github.com/1505787
- ism_rewrite_engine off;
- ##########################################
- # REWRITES #
- ##########################################
- # manifest...
- rewrite ^(.*/)?(.*)\.([is])sm/[Mm]anifest$ $1/$2.ismc last;
- # audio/video fetch rewrites...
- rewrite ^(.*)\/+(\w+)\.([is]sml?)\/+QualityLevels\((\d+)\)\/+Fragments\((\w+)=(\d+)\) $1/$2.$3?bitrate=$4&$5=0&fragments_noun=Fragments&track_name=$5&time=$6 last;
- ##########################################
- location ~ \.ism$ {
- # we only accept get/head request methods
- if ($request_method !~ ^(?:GET|HEAD)$) {
- return 405;
- }
- # check $args; there is a nasty BUG in libfmp4
- # in function mp4_split_options_set()
- # causing nginx worker to segfault unless
- # this check is in place
- if ($args !~ ^bitrate=\d+&(?:audio|video)=\d+.*&track_name=(?:\w+)&time=\d+$) {
- return 400;
- }
- # expires!!!
- expires 2y;
- # activate mod_smooth_streaming
- ism;
- }
- ###################################################
- # LOGGING #
- ###################################################
- access_log "/var/log/nginx/vhost-smooth.access" combined;
- error_log "/var/log/nginx/vhost-smooth.error" warn;
- ###################################################
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement