Commit 421c0f82 authored by hark's avatar hark

cache

parent 868f3641
Pipeline #1210 canceled with stage
......@@ -4,3 +4,6 @@
[submodule "leftover/brave"]
path = leftover/brave
url = git@185.52.224.4:sms/brave.git
[submodule "streaming-media-stuff"]
path = streaming-media-stuff
url = https://git.puscii.nl/sms/streaming-media-stuff.git
......@@ -54,20 +54,16 @@ http {
root /opt/data;
autoindex on;
add_header Cache-Control: public;
add_header Pragma public;
location ~* (.+\.(jpg|jpeg|gif|png|ts))$ {
#immutable responses
expires: max;
add_header Cache-Control: public;
add_header Cache-Control: immutable;
if ($request_method = POST) {
return 405;
}
location ~* .(m3u8)$ {
add_header Cache-Control: public;
add_header Cache-Control: max-age=20;
}
location ~* .(ts)$ {
add_header Cache-Control: public;
add_header Cache-Control: max-age=200;
}
#rewrite ^/$ http://${SD_HOST_HLS_CACHE}/player redirect;
......
......@@ -9,6 +9,21 @@ events {
http {
access_log /dev/stdout combined;
proxy_buffering on;
proxy_cache_path /var/cache/nginx levels=1:2 keys_zone=edge-cache:10m inactive=20m max_size=1g;
proxy_temp_path /var/cache/nginx/tmp;
proxy_cache_lock on;
proxy_cache_use_stale updating, error, timeout, http_404, http_403;
proxy_bind 0.0.0.0;
proxy_cache_valid 200 302 10m;
proxy_cache_valid 301 1h;
proxy_cache_valid any 1m;
add_header X-Cached-ssl $upstream_cache_status;
add_header X-Cache-Date-ssl $upstream_http_date;
server {
listen 80;
server_name ${SD_HOST_HLS_ORIGIN};
......
Subproject commit 6feef4645636aee5ea364415a397ad0581fee873
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment