Add support for NGINX VOD Module

This commit is contained in:
Jason Hunter
2021-05-18 01:52:08 -04:00
committed by Blake Blackshear
parent a4e6d9ed9a
commit aab6a00e4c
9 changed files with 142 additions and 25 deletions

View File

@@ -1,23 +1,24 @@
worker_processes 1;
error_log /var/log/nginx/error.log warn;
error_log /usr/local/nginx/logs/error.log warn;
pid /var/run/nginx.pid;
load_module "modules/ngx_rtmp_module.so";
# load_module "modules/ngx_rtmp_module.so";
# load_module "modules/ngx_http_vod_module.so";
events {
worker_connections 1024;
}
http {
include /etc/nginx/mime.types;
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 /var/log/nginx/access.log main;
access_log /usr/local/nginx/logs/access.log main;
sendfile on;
@@ -37,6 +38,39 @@ http {
server {
listen 5000;
# vod settings
vod_mode mapped;
vod_max_mapping_response_size 1m;
vod_upstream_location /api;
vod_last_modified 'Sun, 19 Nov 2000 08:52:00 GMT';
vod_last_modified_types *;
# vod caches
vod_metadata_cache metadata_cache 512m;
vod_response_cache response_cache 128m;
vod_mapping_cache mapping_cache 5m;
# gzip manifests
gzip on;
gzip_types application/vnd.apple.mpegurl;
# file handle caching / aio
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;
location /vod/ {
vod hls;
add_header Access-Control-Allow-Headers '*';
add_header Access-Control-Expose-Headers 'Server,range,Content-Length,Content-Range';
add_header Access-Control-Allow-Methods 'GET, HEAD, OPTIONS';
add_header Access-Control-Allow-Origin '*';
expires 100d;
}
location /stream/ {
add_header 'Cache-Control' 'no-cache';
add_header 'Access-Control-Allow-Origin' "$http_origin" always;