nginx 缓存各大视频网站。比如优酷 56视频。
大牛们有什么好的解决方案。
各大视频网站缓存了 。 但是 视频缓存下来 很多都重复的 。因为各大视频网站 都做了关键帧。后面有参数的的
比如
http://218.61.21.33/fcs101.56.com/flvdownload/8/22/136443994840hd_clear.flv?t=rAn2YAi_oDtsqd6D1AdIBg&r=61820&e=1364529420&v=1&s=1&m=s
很多视频做了关键帧 后面都有很多参数的。 如果缓存呢。 我用nginx做代理上网。 以下为我的配置文件
server {
listen 3128;
resolver 8.8.8.8;
set $index 'index.shtml';
set $store_file $request_filename;
if ($uri ~ /$ ){
set $store_file $request_filename$index;
rewrite (.*) $1index.shtml last;
}
location ~ .*\.mp4$ {
mp4;
expires max;
index index.shtml;
proxy_store on;
root /cache/data;
proxy_temp_path /cache/temp;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Via "s9/nginx";
proxy_store_access user:rw group:rw all:rw;
proxy_send_timeout 600;
proxy_read_timeout 600;
if ( !-e $store_file ) {
proxy_pass http://$host$request_uri;
}
}
location ~ .*\.flv$ {
flv;
expires max;
index index.shtml;
proxy_store on;
root /cache/data;
proxy_temp_path /cache/temp;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Via "s9/nginx";
proxy_store_access user:rw group:rw all:rw;
proxy_send_timeout 600;
proxy_read_timeout 600;
if ( !-e $store_file ) {
proxy_pass http://$host$request_uri;
}
}
location / {
index index.shtml;
proxy_store on;
root /cache/data;
proxy_temp_path /cache/temp;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Via "s9/nginx";
proxy_store_access user:rw group:rw all:rw;
proxy_send_timeout 600;
proxy_read_timeout 600;
if ( !-e $store_file ) {
proxy_pass http://$host$request_uri;
}
}
}