Skip to content

Instantly share code, notes, and snippets.

@espeon
Last active September 29, 2021 07:39
Show Gist options
  • Select an option

  • Save espeon/62ee3790fcfc2417bfa7cda18ebe8e28 to your computer and use it in GitHub Desktop.

Select an option

Save espeon/62ee3790fcfc2417bfa7cda18ebe8e28 to your computer and use it in GitHub Desktop.
a nginx.conf to be used with kaltura's nginx-vod module
worker_processes auto;
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;
tcp_nodelay on;
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;
server {
listen 80;
server_name localhost;
proxy_ssl_server_name on;
vod_mode remote;
vod_upstream_location /remote;
vod_metadata_cache metadata_cache 256m;
vod_response_cache response_cache 512m;
vod_last_modified_types *;
vod_segment_duration 3000;
vod_align_segments_to_key_frames on;
vod_dash_fragment_file_name_prefix "segment";
vod_hls_segment_file_name_prefix "segment";
vod_max_upstream_headers_size 250k;
vod_dash_absolute_manifest_urls off;
vod_hls_absolute_master_urls off;
vod_hls_absolute_index_urls off;
vod_manifest_segment_durations_mode accurate;
# gzip manifests
gzip on;
gzip_types application/vnd.apple.mpegurl application/x-mpegURL video/f4m application/dash+xml text/xml;
location ^~ /remote/hls/ {
rewrite ^/remote/hls/(.*) /$1 break;
proxy_pass "http://assets.your.net/";
}
location /hls/ {
vod hls;
add_header Access-Control-Allow-Headers '*';
add_header Access-Control-Allow-Origin '*';
add_header Access-Control-Allow-Methods 'GET, HEAD, OPTIONS';
}
location / {
return 200 'OK!';
add_header Content-Type text/plain;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment