I just did a setup of a basic caching reverse proxy in front of Kaltura. I used this thread, among others, to make it work. I thought I’d share how it was done and my understanding of it.
I use two servers:
kalturacdn.com
= reverse proxy.
kalturaserver.com
= kaltura server.
I did the setup for a single partner. As Jess writes above, the default delivery_profiles used when playing an entry can be inspected using:
mysql>select * from delivery_profile where id in (1001,1002,1003)\G
Kaltura configuration
In admin console, in the Profiles column for my partner, I choose Delivery Profile
.
I created a profile with these settings:
type = VOD_PACKAGER_HLS
Streamer Type = APPLE_HTTP
url = http://kalturacdn.com:88/hls
Delivery status = active
It results in the following row in the database (I stripped some irrelevant columns):
id: 1004
partner_id: 102
type: 61
url: http://kalturacdn.com:88/hls
host_name: kalturacdn.com
status: 0
media_protocols: NULL
streamer_type: applehttp
is_default: 0
Next step, in Admin console in the Actions column i choose Configure
.
Under Publisher Specific Delivery Settings
in the Add format
drop-down list, I choose APPLE_HTTP
and click the Add button. I can see my newly created delivery profile. I select it and click the OK button.
Nginx configuration
This is a very basic nginx configuration that I will use as a starting point:
http {
proxy_cache_path /data/nginx/cache_static keys_zone=kaltura_static:100m inactive=10s max_size=1g;
proxy_cache_path /data/nginx/cache_vod keys_zone=kaltura_vod:100m inactive=10s max_size=1g;
server {
listen 88 default_server;
server_name kalturacdn.com;
add_header Access-Control-Allow-Origin *;
proxy_cache kaltura_vod;
location / {
proxy_set_header Host $http_host;
proxy_pass http://kalturaserver.com:88;
}
}
server {
listen 80 default_server;
server_name kalturacdn.com;
proxy_cache kaltura_static;
location / {
proxy_set_header Host $http_host;
proxy_pass http://kalturaserver.com;
}
}
The proxy_set_header
directive is important. It seems the host attribute in the request headers from the reverse proxy will impact what url will be in the index.m3u8 file generated before playback.