chore: save nginx edge conf
continuous-integration/drone/push Build is failing Details

This commit is contained in:
Kieran 2024-02-02 10:22:05 +00:00
parent 32520c4fa5
commit 8e4b785a8f
Signed by: Kieran
GPG Key ID: DE71CEB3925BE941
1 changed files with 53 additions and 0 deletions

53
nginx-edge.conf Normal file
View File

@ -0,0 +1,53 @@
upstream data {
server data.zap.stream;
}
server {
listen 80;
listen [::]:80;
listen 443 ssl;
listen [::]:443 ssl;
access_log off;
server_name us0.edge.zap.stream;
# For Proxy Cache.
proxy_cache_valid 404 10s;
proxy_cache_lock on;
proxy_cache_lock_age 300s;
proxy_cache_lock_timeout 300s;
proxy_cache_min_uses 1;
proxy_set_header Host data.zap.stream;
proxy_set_header X-Real-IP $remote_addr;
ssl_certificate /etc/letsencrypt/live/us0.edge.zap.stream/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/us0.edge.zap.stream/privkey.pem;
location ~ /.+/.*\.(m3u8)$ {
proxy_pass http://data$request_uri;
# For Proxy Cache.
proxy_cache srs_cache;
proxy_cache_key $scheme$proxy_host$uri$args;
proxy_cache_valid 200 302 10s;
proxy_hide_header 'Access-Control-Allow-Origin';
add_header 'Access-Control-Allow-Origin' '*' always;
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS' always;
add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range' always;
add_header 'Access-Control-Expose-Headers' 'Content-Length,Content-Range' always;
}
location ~ /.+/.*\.(ts)$ {
proxy_pass http://data$request_uri;
# For Proxy Cache.
proxy_cache srs_cache;
proxy_cache_key $scheme$proxy_host$uri;
proxy_cache_valid 200 302 60m;
proxy_hide_header 'Access-Control-Allow-Origin';
add_header 'Access-Control-Allow-Origin' '*' always;
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS' always;
add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range' always;
add_header 'Access-Control-Expose-Headers' 'Content-Length,Content-Range' always;
}
location / {
root /usr/share/nginx/html;
try_files $uri $uri/ =404;
}
}