proxy_cache_path /var/www/html/cache3 levels=1:2:2 keys_zone=ssd_cache:200m max_size=440G loader_threshold=350 loader_files=300 inactive=14h use_temp_path=on;
proxy_temp_path /var/www/html/temp_cache 1 2 2;
proxy_cache_key "$uri$slice_range";
upstream backend {
keepalive 25;
server 10.0.0.1:81;
}
server {
listen 443 ssl default_server;
ssl_certificate /var/www/cert.pem;
ssl_certificate_key /var/www/privkey.pem;
root /var/www/html;
location / {
aio threads=default;
sendfile on;
tcp_nopush on;
tcp_nodelay on;
mp4;
mp4_buffer_size 8M;
mp4_max_buffer_size 20M;
aio_write on;
expires max;
proxy_http_version 1.1;
proxy_set_header Connection "";
slice 5m;
output_buffers 1 512k;
proxy_cache_min_uses 1;
proxy_set_header Range $slice_range;
proxy_cache_valid 200 206 76h;
proxy_cache_valid 404 20;
proxy_cache ssd_cache;
proxy_cache_key $uri$slice_range;
proxy_pass
http://backend;
proxy_cache_lock on;
proxy_cache_lock_age 50s;
proxy_cache_lock_timeout 0s;
proxy_cache_use_stale updating;
client_max_body_size 10m;
client_body_buffer_size 128k;
proxy_send_timeout 90;
proxy_read_timeout 90;
proxy_buffer_size 16k;
proxy_buffers 10 16k;
proxy_busy_buffers_size 16k;
proxy_temp_file_write_size 16k;
proxy_connect_timeout 30s;
keepalive_timeout 10s;
limit_rate 1000k;
}
}
server {
listen 808 reuseport;
root /var/www/html/files/;
location / {
send_timeout 40;
aio threads;
directio 512;
output_buffers 1 4m;
keepalive_timeout 30s;
expires max;
sendfile on;
add_header Cache-Control public;
sendfile_max_chunk 512k;
open_file_cache max=200000 inactive=24h;
open_file_cache_valid 24h;
open_file_cache_min_uses 1;
open_file_cache_errors on;
}
}