Verified Commit ae285706 authored by Lukas Schauer's avatar Lukas Schauer 🔓

access controll stuff

parent cbad5718
......@@ -27,6 +27,9 @@ location /check_key {
location ~ ^/(?<lecture>[0-9]+)/(?<video>[0-9]+)/attachments/(?<attachment>[^/]+)$ {
auth_request /check_key;
add_header 'Access-Control-Allow-Origin' 'https://lectures.fslab.de';
add_header 'Access-Control-Allow-Credentials' 'true';
add_header 'Access-Control-Allow-Methods' 'GET, HEAD, OPTIONS';
add_header "X-Cache-Status" "$upstream_cache_status";
#add_header "Content-Disposition" "attachment; filename=${lecture}_${video}_${attachment}";
proxy_pass https://lectures.fslab.de/uploads/$lecture/$video/attachments/$attachment;
......@@ -35,13 +38,31 @@ location ~ ^/(?<lecture>[0-9]+)/(?<video>[0-9]+)/attachments/(?<attachment>[^/]+
location ~ ^/(?<lecture>[0-9]+)/(?<video>[0-9]+)/thumbnail.jpg$ {
auth_request /check_key;
add_header 'Access-Control-Allow-Origin' 'https://lectures.fslab.de';
add_header 'Access-Control-Allow-Credentials' 'true';
add_header 'Access-Control-Allow-Methods' 'GET, HEAD, OPTIONS';
add_header "X-Cache-Status" "$upstream_cache_status";
proxy_pass https://lectures.fslab.de/uploads/$lecture/$video/thumbnail.jpg;
proxy_set_header Authorization "Basic {{ ('cdn:' + videoportal_cdn_password) | b64encode }}";
}
location ~ ^/(?<lecture>[0-9]+)/(?<video>[0-9]+)/subtitles.vtt$ {
auth_request /check_key;
add_header 'Access-Control-Allow-Origin' 'https://lectures.fslab.de';
add_header 'Access-Control-Allow-Credentials' 'true';
add_header 'Access-Control-Allow-Methods' 'GET, HEAD, OPTIONS';
add_header "X-Cache-Status" "$upstream_cache_status";
add_header "Content-Type" "text/vtt; charset=utf-8";
proxy_pass https://lectures.fslab.de/uploads/$lecture/$video/subtitles.vtt;
proxy_hide_header "Content-Type";
proxy_set_header Authorization "Basic {{ ('cdn:' + videoportal_cdn_password) | b64encode }}";
}
location ~ ^/(?<lecture>[0-9]+)/(?<video>[0-9]+)/(?<file>[^/]+)$ {
auth_request /check_key;
add_header 'Access-Control-Allow-Origin' 'https://lectures.fslab.de';
add_header 'Access-Control-Allow-Credentials' 'true';
add_header 'Access-Control-Allow-Methods' 'GET, HEAD, OPTIONS';
add_header "X-Cache-Status" "$upstream_cache_status";
add_header "Content-Disposition" "attachment; filename=${lecture}_${video}_${file}";
proxy_cache_key "$scheme$proxy_host$uri";
......
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