feat: add nginx media & cdn from web1

This commit is contained in:
2024-07-20 10:24:05 +00:00
parent 68b48fd211
commit 342e950274
6 changed files with 104 additions and 0 deletions

View File

@@ -0,0 +1,16 @@
server {
autoindex on;
autoindex_localtime on;
listen 5051;
root /var/www/cdn/;
add_header Vary Accept-Encoding;
add_header Access-Control-Allow-Origin $http_origin;
location /videos/{
default_type video/mp4;
limit_rate 2m;
autoindex on;
}
}

View File

@@ -0,0 +1,2 @@
kathi:$y$j9T$HISTORY_PURGED_SECRET
sheppy:$y$HISTORY_PURGED_SECRET

View File

@@ -0,0 +1,19 @@
server {
listen 5053;
access_log off;
gzip off;
default_type text/plain;
if ($remote_addr ~* 172\.16\.1\.(.+)){
return 200 "$remote_addr (This is a local VPN ip, it is NOT your true external ip!)";
}
if ($remote_addr ~* 192\.168\.122\.1){
return 200 $http_x_real_ip;
}
location / {
return 200 $remote_addr;
}
}

View File

@@ -0,0 +1,28 @@
map $http_x_nginx_cert_auth $basic_auth_val {
default "private";
true off;
}
server {
autoindex on;
autoindex_localtime on;
listen 5052;
root /var/www/media;
add_header Vary Accept-Encoding;
add_header Access-Control-Allow-Origin $http_origin;
location /videos/{
default_type video/mp4;
limit_rate 2m;
autoindex on;
}
location /auth/{
auth_basic $basic_auth_val;
auth_basic_user_file /etc/nginx/htpasswd_1;
}
}