livecdn: add CORS

close !6

commit 77ed77aa93
Author: Lukas Schulz <lukas.schulz@simiworld.de>
Date:   Tue Dec 1 21:33:13 2020 +0100

    repositioned second CORS header

commit fe01c721a6
Author: Lukas Schulz <lukas.schulz@simiworld.de>
Date:   Tue Dec 1 21:32:36 2020 +0100

    escaped '

commit 6b50ef9de5
Author: Lukas Schulz <lukas.schulz@simiworld.de>
Date:   Tue Dec 1 21:28:24 2020 +0100

    repositioned cors header

commit cdaad1a973
Author: Lukas Schulz <lukas.schulz@simiworld.de>
Date:   Tue Dec 1 21:25:29 2020 +0100

    added cors header

commit bc30682b9e
Author: Lukas Schulz <lukas.schulz@simiworld.de>
Date:   Tue Dec 1 21:21:15 2020 +0100

    changed cdn-url to https to fix mixed content stuff

Signed-off-by: hexchen <hexchen@lilwit.ch>
keep-around/cafbe5bb79536d5dd85c93b828ecfac8761fcc2e
hexchen 2020-12-01 20:37:02 +00:00
parent 51d17d27d8
commit cafbe5bb79
2 changed files with 5 additions and 1 deletions

View File

@ -8,7 +8,7 @@
virtualHosts."${config.networking.hostName}.live.hacc.media" = {
locations = {
"/" = {
return = "301 \"http://$cdnhosts$request_uri\"";
return = "301 \"https://$cdnhosts$request_uri\"";
extraConfig = ''
auth_basic off;
'';

View File

@ -10,14 +10,17 @@ in {
virtualHosts."${config.networking.hostName}.live.hacc.media" = {
locations = {
"~* \\.(m3u8)$" = {
proxyPass = "${host-server}$request_uri";
extraConfig = ''
#proxy_cache = off;
expires 2s;
auth_basic off;
add_header 'Access-Control-Allow-Origin' '*';
'';
};
"/hls" = {
proxyPass = "${host-server}$request_uri";
extraConfig = ''
types {
@ -28,6 +31,7 @@ in {
proxy_ignore_headers Cache-Control;
proxy_cache_valid any 30m;
auth_basic off;
add_header 'Access-Control-Allow-Origin' '*';
'';
};
};