worker_processes auto; pid /run/nginx.pid; events { use epoll; } http { log_format main '$remote_addr $remote_user [$time_local] "$request" ' '$status "$http_referer" "$http_user_agent"'; access_log /dev/stdout main; error_log stderr debug; default_type application/octet-stream; include /usr/local/nginx/conf/mime.types; sendfile on; tcp_nopush on; tcp_nodelay on; vod_mode local; vod_metadata_cache metadata_cache 16m; vod_response_cache response_cache 512m; vod_last_modified_types *; vod_segment_duration 9000; vod_align_segments_to_key_frames on; vod_dash_fragment_file_name_prefix "segment"; vod_hls_segment_file_name_prefix "segment"; vod_manifest_segment_durations_mode accurate; open_file_cache max=1000 inactive=5m; open_file_cache_valid 2m; open_file_cache_min_uses 1; open_file_cache_errors on; aio on; # secure_token_akamai $secure_token { # key RANDOM_HEX; # acl "$secure_token_baseuri_comma*"; # param_name token; # } server { listen 80; server_name localhost; root /var/www/html; location ~ ^/videos/.+$ { autoindex on; } location /hls/ { vod hls; alias /var/www/html/videos/; if ($arg_token) { set $input_token $arg_token; } add_header Access-Control-Allow-Headers '*'; add_header Access-Control-Allow-Origin '*'; add_header Access-Control-Allow-Methods 'GET, HEAD, OPTIONS'; #akamai_token_validate $input_token; #akamai_token_validate_key RANDOM_HEX; #secure_token $secure_token; #secure_token_types application/vnd.apple.mpegurl; #secure_token_expires_time 100d; #secure_token_query_token_expires_time 1h; } location /thumb/ { vod thumb; alias /var/www/html/videos/; add_header Access-Control-Allow-Headers '*'; add_header Access-Control-Allow-Origin '*'; add_header Access-Control-Allow-Methods 'GET, HEAD, OPTIONS'; } } }