Permalink
Fetching contributors…
Cannot retrieve contributors at this time
513 lines (420 sloc) 12.1 KB
worker_processes 1;
error_log /var/log/nginx/error.log debug;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
multi_accept on;
use epoll;
}
http {
include mime.types;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $bytes_sent $request_time "$http_referer" '
'"$http_user_agent" "$http_x_kaltura_f5_https" $http_x_kaltura_f5_remote_addr '
'"$sent_http_x_kaltura" "$http_host" $pid $sent_http_x_kaltura_session - '
'$request_length "$sent_http_content_range" "$http_x_forwarded_for" '
'"$http_x_forwarded_server" "$http_x_forwarded_host" "$sent_http_cache_control" '
'$connection ';
access_log /var/log/nginx/access.log main;
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 60;
keepalive_requests 1000;
client_header_timeout 20;
client_body_timeout 20;
reset_timedout_connection on;
send_timeout 20;
add_header X-Me $hostname;
gzip on;
gzip_types application/vnd.apple.mpegurl;
# common vod settings
vod_metadata_cache metadata_cache 512m;
vod_mapping_cache mapping_cache 5m;
vod_response_cache response_cache 128m;
vod_drm_info_cache drm_cache 64m;
# common proxy settings
proxy_connect_timeout 5;
proxy_send_timeout 5;
proxy_read_timeout 5;
# common file caching / aio
open_file_cache max=100 inactive=5m;
open_file_cache_valid 2m;
open_file_cache_min_uses 1;
open_file_cache_errors on;
aio on;
upstream kalapi {
server localhost:80;
}
upstream self {
server localhost:8001;
keepalive 32;
}
upstream testapi {
server localhost:8002;
}
upstream fallback {
server localhost:8003;
}
upstream drmservice {
server localhost:8004;
}
server {
listen 8001 backlog=1024;
server_name localhost;
# location for testing keep-alive - any requests to /self/xxx get proxied to xxx with keepalive
# the tested module "sees" keepalive connections even though the test code is not using keepalive
location /self/ {
proxy_pass http://self/;
proxy_http_version 1.1;
proxy_set_header Connection "";
proxy_set_header Host $http_host;
}
# internal location for vod subrequests
location /kalapi_proxy/ {
internal;
proxy_pass http://kalapi/;
proxy_set_header Host $http_host;
}
location /testapi_proxy/ {
internal;
proxy_pass http://testapi/;
proxy_set_header Host $http_host;
}
location /fallback_proxy/ {
internal;
proxy_pass http://fallback/;
proxy_set_header Host $http_host;
}
location /drmservice_proxy/ {
internal;
proxy_pass http://drmservice/;
proxy_set_header Host $http_host;
}
# non-encrypted
# local
location /local/hls/content/ {
alias /web/content/;
vod hls;
vod_mode local;
add_header X-Me $hostname;
add_header Last-Modified "Sun, 19 Nov 2000 08:52:00 GMT";
expires 100d;
}
# mapped
location ~ ^/mapped/hls/p/\d+/(sp/\d+/)?serveFlavor/ {
vod hls;
vod_mode mapped;
vod_upstream_location /kalapi_proxy/;
vod_upstream_extra_args "pathOnly=1";
add_header X-Me $hostname;
add_header Last-Modified "Sun, 19 Nov 2000 08:52:00 GMT";
expires 100d;
}
location ~ ^/mapped/hds/p/\d+/(sp/\d+/)?serveFlavor/ {
vod hds;
vod_segment_duration 6000;
vod_mode mapped;
vod_upstream_location /kalapi_proxy/;
vod_upstream_extra_args "pathOnly=1";
vod_align_segments_to_key_frames on;
add_header X-Me $hostname;
add_header Last-Modified "Sun, 19 Nov 2000 08:52:00 GMT";
expires 100d;
}
location ~ ^/mapped/dash/p/\d+/(sp/\d+/)?serveFlavor/ {
vod dash;
vod_mode mapped;
vod_upstream_location /kalapi_proxy/;
vod_upstream_extra_args "pathOnly=1";
vod_segment_duration 4000;
add_header X-Me $hostname;
add_header Last-Modified "Sun, 19 Nov 2000 08:52:00 GMT";
add_header Access-Control-Allow-Headers "origin,range,accept-encoding,referer";
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 ~ ^/mapped/mss/p/\d+/(sp/\d+/)?serveFlavor/ {
vod mss;
vod_mode mapped;
vod_upstream_location /kalapi_proxy/;
vod_upstream_extra_args "pathOnly=1";
vod_segment_duration 4000;
add_header X-Me $hostname;
add_header Last-Modified "Sun, 19 Nov 2000 08:52:00 GMT";
expires 100d;
}
# remote
location ~ ^/remote/hls/p/\d+/(sp/\d+/)?serveFlavor/ {
vod hls;
vod_mode remote;
vod_upstream_location /kalapi_proxy/;
add_header X-Me $hostname;
add_header Last-Modified "Sun, 19 Nov 2000 08:52:00 GMT";
expires 100d;
}
# local
location /local/content/ {
alias /web/content/;
vod none;
vod_mode local;
add_header X-Me $hostname;
add_header Last-Modified "Sun, 19 Nov 2000 08:52:00 GMT";
expires 100d;
}
# mapped
location ~ ^/mapped/p/\d+/(sp/\d+/)?serveFlavor/ {
vod none;
vod_mode mapped;
vod_upstream_location /kalapi_proxy/;
vod_upstream_extra_args "pathOnly=1";
add_header X-Me $hostname;
add_header Last-Modified "Sun, 19 Nov 2000 08:52:00 GMT";
expires 100d;
}
# remote
location ~ ^/remote/p/\d+/(sp/\d+/)?serveFlavor/ {
vod none;
vod_mode remote;
vod_upstream_location /kalapi_proxy/;
add_header X-Me $hostname;
add_header Last-Modified "Sun, 19 Nov 2000 08:52:00 GMT";
expires 100d;
}
# tests local
location /tlocal/content/ {
alias /web/content/;
vod none;
vod_mode local;
vod_fallback_upstream_location /fallback_proxy/;
add_header X-Me $hostname;
add_header Last-Modified "Sun, 19 Nov 2000 08:52:00 GMT";
expires 100d;
}
# tests mapped
location ~ ^/tmapped/p/\d+/(sp/\d+/)?serveFlavor/ {
vod none;
vod_mode mapped;
vod_upstream_location /testapi_proxy/;
vod_fallback_upstream_location /fallback_proxy/;
vod_upstream_extra_args "pathOnly=1";
add_header X-Me $hostname;
add_header Last-Modified "Sun, 19 Nov 2000 08:52:00 GMT";
expires 100d;
}
# tests remote
location ~ ^/tremote/p/\d+/(sp/\d+/)?serveFlavor/ {
vod none;
vod_mode remote;
vod_upstream_location /testapi_proxy/;
add_header X-Me $hostname;
add_header Last-Modified "Sun, 19 Nov 2000 08:52:00 GMT";
expires 100d;
}
# tests local hls
location /tlocal/hls/content/ {
alias /web/content/;
vod hls;
vod_mode local;
vod_fallback_upstream_location /fallback_proxy/;
add_header X-Me $hostname;
add_header Last-Modified "Sun, 19 Nov 2000 08:52:00 GMT";
expires 100d;
}
# tests mapped hls
location ~ ^/tmapped/hls/p/\d+/(sp/\d+/)?serveFlavor/ {
vod hls;
vod_mode mapped;
vod_upstream_location /testapi_proxy/;
vod_fallback_upstream_location /fallback_proxy/;
vod_upstream_extra_args "pathOnly=1";
add_header X-Me $hostname;
add_header Last-Modified "Sun, 19 Nov 2000 08:52:00 GMT";
expires 100d;
}
# tests remote hls
location ~ ^/tremote/hls/p/\d+/(sp/\d+/)?serveFlavor/ {
vod hls;
vod_mode remote;
vod_upstream_location /testapi_proxy/;
add_header X-Me $hostname;
add_header Last-Modified "Sun, 19 Nov 2000 08:52:00 GMT";
expires 100d;
}
# tests local dash
location /tlocal/dash/content/ {
alias /web/content/;
vod dash;
vod_mode local;
vod_fallback_upstream_location /fallback_proxy/;
add_header X-Me $hostname;
add_header Last-Modified "Sun, 19 Nov 2000 08:52:00 GMT";
expires 100d;
}
# tests mapped dash
location ~ ^/tmapped/dash/p/\d+/(sp/\d+/)?serveFlavor/ {
vod dash;
vod_mode mapped;
vod_upstream_location /testapi_proxy/;
vod_fallback_upstream_location /fallback_proxy/;
vod_upstream_extra_args "pathOnly=1";
add_header X-Me $hostname;
add_header Last-Modified "Sun, 19 Nov 2000 08:52:00 GMT";
expires 100d;
}
# tests remote dash
location ~ ^/tremote/dash/p/\d+/(sp/\d+/)?serveFlavor/ {
vod dash;
vod_mode remote;
vod_upstream_location /testapi_proxy/;
add_header X-Me $hostname;
add_header Last-Modified "Sun, 19 Nov 2000 08:52:00 GMT";
expires 100d;
}
# tests remote edash
location ~ ^/tremote/edash/p/\d+/(sp/\d+/)?serveFlavor/ {
vod dash;
vod_mode remote;
vod_upstream_location /testapi_proxy/;
vod_drm_enabled on;
vod_drm_upstream_location /drmservice_proxy/;
add_header X-Me $hostname;
add_header Last-Modified "Sun, 19 Nov 2000 08:52:00 GMT";
expires 100d;
}
# tests local hds
location /tlocal/hds/content/ {
alias /web/content/;
vod hds;
vod_mode local;
vod_fallback_upstream_location /fallback_proxy/;
add_header X-Me $hostname;
add_header Last-Modified "Sun, 19 Nov 2000 08:52:00 GMT";
expires 100d;
}
# tests mapped hds
location ~ ^/tmapped/hds/p/\d+/(sp/\d+/)?serveFlavor/ {
vod hds;
vod_mode mapped;
vod_upstream_location /testapi_proxy/;
vod_fallback_upstream_location /fallback_proxy/;
vod_upstream_extra_args "pathOnly=1";
add_header X-Me $hostname;
add_header Last-Modified "Sun, 19 Nov 2000 08:52:00 GMT";
expires 100d;
}
# tests remote hds
location ~ ^/tremote/hds/p/\d+/(sp/\d+/)?serveFlavor/ {
vod hds;
vod_mode remote;
vod_upstream_location /testapi_proxy/;
add_header X-Me $hostname;
add_header Last-Modified "Sun, 19 Nov 2000 08:52:00 GMT";
expires 100d;
}
# tests local mss
location /tlocal/mss/content/ {
alias /web/content/;
vod mss;
vod_mode local;
vod_fallback_upstream_location /fallback_proxy/;
add_header X-Me $hostname;
add_header Last-Modified "Sun, 19 Nov 2000 08:52:00 GMT";
expires 100d;
}
# tests mapped mss
location ~ ^/tmapped/mss/p/\d+/(sp/\d+/)?serveFlavor/ {
vod mss;
vod_mode mapped;
vod_upstream_location /testapi_proxy/;
vod_fallback_upstream_location /fallback_proxy/;
vod_upstream_extra_args "pathOnly=1";
add_header X-Me $hostname;
add_header Last-Modified "Sun, 19 Nov 2000 08:52:00 GMT";
expires 100d;
}
# tests remote mss
location ~ ^/tremote/mss/p/\d+/(sp/\d+/)?serveFlavor/ {
vod mss;
vod_mode remote;
vod_upstream_location /testapi_proxy/;
add_header X-Me $hostname;
add_header Last-Modified "Sun, 19 Nov 2000 08:52:00 GMT";
expires 100d;
}
# encrypted
# local
location /local/hls/enc/content/ {
alias /web/content/;
vod hls;
vod_mode local;
vod_secret_key password;
add_header X-Me $hostname;
add_header Last-Modified "Sun, 19 Nov 2000 08:52:00 GMT";
expires 100d;
}
# mapped
location ~ ^/mapped/hls/enc/p/\d+/(sp/\d+/)?serveFlavor/ {
vod hls;
vod_mode mapped;
vod_secret_key password;
vod_upstream_location /kalapi_proxy/;
vod_upstream_extra_args "pathOnly=1";
add_header X-Me $hostname;
add_header Last-Modified "Sun, 19 Nov 2000 08:52:00 GMT";
expires 100d;
}
# remote
location ~ ^/remote/hls/enc/p/\d+/(sp/\d+/)?serveFlavor/ {
vod hls;
vod_mode remote;
vod_secret_key password;
vod_upstream_location /kalapi_proxy/;
add_header X-Me $hostname;
add_header Last-Modified "Sun, 19 Nov 2000 08:52:00 GMT";
expires 100d;
}
# tests local
location /tlocal/hls/enc/content/ {
alias /web/content/;
vod hls;
vod_mode local;
vod_secret_key password;
vod_fallback_upstream_location /fallback_proxy/;
add_header X-Me $hostname;
add_header Last-Modified "Sun, 19 Nov 2000 08:52:00 GMT";
expires 100d;
}
# tests mapped
location ~ ^/tmapped/hls/enc/p/\d+/(sp/\d+/)?serveFlavor/ {
vod hls;
vod_mode mapped;
vod_secret_key password;
vod_upstream_location /testapi_proxy/;
vod_fallback_upstream_location /fallback_proxy/;
vod_upstream_extra_args "pathOnly=1";
add_header X-Me $hostname;
add_header Last-Modified "Sun, 19 Nov 2000 08:52:00 GMT";
expires 100d;
}
# tests remote
location ~ ^/tremote/hls/enc/p/\d+/(sp/\d+/)?serveFlavor/ {
vod hls;
vod_mode remote;
vod_secret_key password;
vod_upstream_location /testapi_proxy/;
add_header X-Me $hostname;
add_header Last-Modified "Sun, 19 Nov 2000 08:52:00 GMT";
expires 100d;
}
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
}