Skip to content
Snippets Groups Projects
Commit 0108150f authored by Antoine SCHILDKNECHT's avatar Antoine SCHILDKNECHT
Browse files

Remove mediacache templates folder | refs #37557

parents 34df501a ca6a747e
No related branches found
No related tags found
No related merge requests found
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>UbiCast cache server</title>
<style>
html { background: #222; color: #ddd; }
body { margin: 0 auto; max-width: 500px; }
a { color: #5cf; text-decoration: none; }
a:hover { text-decoration: underline; }
</style>
</head>
<body>
<h1>UbiCast cache server</h1>
<hr/>
<p>Powered by UbiCast -- <a href="https://www.ubicast.eu">https://www.ubicast.eu</a></p>
</body>
</html>
# Cache configuration
# Maximum retention of 30 days
# 1G of RAM for keys zone (one megabyte can store about 8 thousand keys)
# wost case is up to 2800 hours of 720p video (50M files) on a 2 TB cache
# WARNING: keys_zone=name:size size does not accept g units, only m
# https://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_cache_path
proxy_cache_path {{ mediacache_folder }} levels=1:2 keys_zone=mediacache:1000m max_size={{ mediacache_size }}g inactive=30d;
server {
listen 80 default_server;
server_name {{ mc_url }};
location /.well-known/acme-challenge {
default_type "text/plain";
root /var/www/letsencrypt;
}
location / {
return 301 https://$host$request_uri;
}
}
server {
listen 443 default_server ssl backlog=15000;
server_name {{ mc_url }};
root /var/www/mediacache/;
location /crossdomain {
}
location /streaming/ {
# Live; expiration headers are defined by upstream (nginx/wowza)
rewrite ^/(.*)$ /$1? break;
proxy_pass https://{{ ms_url }};
proxy_cache mediacache;
# do not consider secure urls as new files
proxy_cache_key $scheme$proxy_host$uri;
# only one request at a time will be allowed to populate a new cache element
proxy_cache_lock on;
# hide upstream X-Cache header
proxy_hide_header X-Cache;
# add own X-Cache header
add_header X-Cache $upstream_cache_status;
# rm cookie
proxy_hide_header Set-Cookie;
proxy_ignore_headers Set-Cookie;
}
location /resources/ {
# VOD
location ~ \.(m3u8|ts|mp4|mp3|oga|ogv|ogg|mov|flv)$ {
rewrite ^/(.*)$ /$1? break;
proxy_pass https://{{ ms_url }};
proxy_cache mediacache;
# do not consider secure urls as new files
proxy_cache_key $scheme$proxy_host$uri;
# only one request at a time will be allowed to populate a new cache element
proxy_cache_lock on;
# how long should the data be kept in the cache
proxy_cache_valid 200 30d;
# instruct browser to cache this
expires 7d;
# headers
proxy_ignore_headers "Cache-Control" "X-Accel-Expires" "Expires";
add_header X-Cache $upstream_cache_status;
# rm cookie
proxy_hide_header Set-Cookie;
proxy_ignore_headers Set-Cookie;
}
}
location / {
# only urls to video and audio files are allowed, discard any requested path for other urls
rewrite ^/(.*)$ /index.html? break;
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment