Move HLS file path to tempfs

This commit is contained in:
Oliver Traber 2021-07-30 22:58:51 +02:00
parent 75321cb769
commit 80202deb89
Signed by: Bluemedia
GPG key ID: C7BA47275B086E2C
2 changed files with 22 additions and 10 deletions

View file

@ -72,7 +72,8 @@ rtmp {
# Turn on HLS
hls on;
hls_path /var/www/html/hls/;
hls_path /tmp/hls;
hls_fragment_naming system;
hls_fragment {HLS_FRAGMENT_LENGTH};
hls_playlist_length {HLS_PLAYLIST_LENGTH};
}
@ -108,12 +109,17 @@ http {
return 404;
}
# Disable cache
add_header 'Cache-Control' 'no-cache';
# Serve HLS files from tempfs
location /hls {
root /tmp;
# Don't let browsers cache HLS files
add_header Cache-Control no-cache;
}
root /var/www/html/;
index index.html index.htm;
# Serve frontend
location / {
root /var/www/html;
index index.html index.htm;
try_files $uri $uri/ =404;
}
}

View file

@ -59,7 +59,8 @@ rtmp {
# Turn on HLS
hls on;
hls_path /var/www/html/hls/;
hls_path /tmp/hls;
hls_fragment_naming system;
hls_fragment {HLS_FRAGMENT_LENGTH};
hls_playlist_length {HLS_PLAYLIST_LENGTH};
}
@ -95,12 +96,17 @@ http {
return 404;
}
# Disable cache
add_header 'Cache-Control' 'no-cache';
# Serve HLS files from tempfs
location /hls {
root /tmp;
# Don't let browsers cache HLS files
add_header Cache-Control no-cache;
}
root /var/www/html/;
index index.html index.htm;
# Serve frontend
location / {
root /var/www/html;
index index.html index.htm;
try_files $uri $uri/ =404;
}
}