ðòïåëôù 


  áòèé÷ 


Apache-Talk @lexa.ru 

Inet-Admins @info.east.ru 

Filmscanners @halftone.co.uk 

Security-alerts @yandex-team.ru 

nginx-ru @sysoev.ru 


  óôáôøé 


  ðåòóïîáìøîïå 


  ðòïçòáííù 



ðéûéôå
ðéóøíá












     áòèé÷ :: nginx-ru
Nginx-ru mailing list archive (nginx-ru@sysoev.ru)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: MP4 + proxy_cache/proxy_store



óÐÁÓÉÂÏ ÚÁ ËÏÎÆÉÇ, Ë ÓÏÖÁÌÅÎÉÀ ÕÐÅÒÓÑ × out ÎÁ origin ÓÅÒ×ÅÒÁÈ.
åÓÌÉ ÖÅ ÓÄÅÌÁÔØ Ó limit_zone ÐÏ $uri ÔÏ edge ÕËÌÁÄÙ×ÁÅÔÓÑ ÐÏ IO.

ñ ÔÕÔ ÎÅÍÎÏÇÏ ÐÅÒÅÒÁÂÏÔÁÌ ËÏÎÆÉÇ, ×ÙÛÌÏ ×ÏÔ ÔÁËÏÅ, ÅÓÌÉ ËÏÍÕ ÉÎÔÅÒÅÓÎÏ.

limit_zone one $binary_remote_addr 64k;

server {
š š listen 127.0.0.1:812;
š š server_name _;

š š root /media;
š š location / {
limit_conn one 1;
š š š š proxy_pass http://origin;
š š š š proxy_ignore_client_abort on;
š š š š proxy_store on;
š š }
}

server {
š š listen š š š 1.1.1.1:80;
š š server_name š_;

š š root /media;
š š location / {
internal;
aio š š š š š š on;
directio š š š š512;
output_buffers š1 128k;

location ~* \.mp4$ {
š šmp4;
š štry_files $uri @origin;
š šlimit_rate_after š1m;
š šlimit_rate š š š š200k;
}
š š š š š š š š š š š š š š š š š š š š
location ~* \.flv$ {
š šflv;
š štry_files $uri @origin;
š šlimit_rate_after š1m;
š šlimit_rate š š š š200k;
}
š š }
š šš
š š location /dl/ {
return 503;
location ~ ^/dl/(?P<secure_hash>[\w\-=]+,\d+)(?P<file>/.+)$ {
š šsecure_link $secure_hash;
š šsecure_link_md5 $secure_link_expires.$file.<passphrase>;
š š
š šif ($secure_link = "") {
return 403;
š š}
š šif ($secure_link = 0) {
return 403;
š š}
š šrewrite ^ /$file last;
}
š š }

š š location @origin {
š š š š proxy_ignore_client_abort on;
š š š š proxy_intercept_errors on;
š š š š error_page 503 = @stream;
š š }

š š location @stream {
proxy_pass http://origin;
proxy_buffering off;
š š }
}


2011/10/24 Kruglov Eugenie <ekruglov@xxxxxxxxx>
ššš limit_zone one $binary_remote_addr 64k;
ššš server {
ššš ššš listen 127.0.0.101:812;
ššš ššš server_name host_stream_store;

ššš ššš location ~ '^/store/(\d+_(\d+)_[\da-f]{32}\.flv)$' {
ššš ššš ššš limit_conn one 1;
ššš ššš ššš proxy_pass http://remote-backend/$1;
ššš ššš ššš proxy_store /mnt/storage/streaming/$2.flv;
ššš ššš }
ššš }

ššš server {
ššš ššš server_name frontend;

ššš ššš location ~ '^/\d+_(\d+)_[\da-f]{32}\.flv$' {
ššš ššš ššš set $args_start $args;
ššš ššš ššš if ( -f /mnt/storage/streaming/$1.flv ){
ššš ššš ššš ššš rewrite ^ /stream$request_uri last;
ššš ššš ššš }
ššš ššš ššš rewrite ^ /stream_store$request_uri last;
ššš ššš }
ššš ššš locationš @stream {
ššš ššš ššš proxy_pass http://remote-backend$request_uri;
ššš ššš ššš proxy_set_header Host remote-backend;
ššš ššš }
ššš ššš location ~ '^/stream_store/(\d+_\d+_[\da-f]{32}\.flv)'š {
ššš ššš ššš internal;
ššš ššš ššš proxy_pass http://127.0.0.101:812/store/$1;
ššš ššš ššš proxy_intercept_errors on;
ššš ššš ššš error_page 503 = @stream;
ššš ššš }
ššš ššš location ~ ^/stream/\d/\d/([^/]+\.flv)$ {
ššš ššš ššš internal;
ššš ššš ššš set $args $args_start;
ššš ššš ššš alias /mnt/storage/streaming/$1;
ššš ššš ššš mp4;
ššš ššš }
ššš }

2011/10/24 Alexander Moskalenko <alexander.moskalenko@xxxxxxxxx>
2011/10/24 Kruglov Eugenie <ekruglov@xxxxxxxxx>
åÓÌÉ ÕÓÔÒÏÉÔ ÒÅÁÌÉÚÁÃÉÑ, ÐÒÉ ËÏÔÏÒÏÊ ×Ï ×ÒÅÍÑ ÒÁÂÏÔÙ proxy_store ÏÄÎÏÍÕ ËÌÉÅÎÔÕ ×ÓÅ ÏÓÔÁÌØÎÙÅ ÐÒÏËÓÉÒÕÀÔÓÑ ÎÁ ÂÅËÅÎÄ - ÍÏÇÕ ×ÙÌÏÖÉÔØ ËÏÎÆÉÇ.

÷ÙËÌÁÄÙ×ÁÊÔÅ, ×ÏÚÍÏÖÎÏ ÈÏÔØ ÐÏÄÔÏÌËÅÔ × ÎÕÖÎÏÅ ÎÁÐÒÁ×ÌÅÎÉÅ.

_______________________________________________
nginx-ru mailing list
nginx-ru@xxxxxxxxx
http://mailman.nginx.org/mailman/listinfo/nginx-ru



--
Faithfully yours, Eugenie
ICQ #701217
GTalk ekruglov@xxxxxxxxx

_______________________________________________
nginx-ru mailing list
nginx-ru@xxxxxxxxx
http://mailman.nginx.org/mailman/listinfo/nginx-ru

_______________________________________________
nginx-ru mailing list
nginx-ru@xxxxxxxxx
http://mailman.nginx.org/mailman/listinfo/nginx-ru


 




Copyright © Lexa Software, 1996-2009.