Спасибо за конфиг, к сожалению уперся в out на origin серверах.<div>Если же сделать с limit_zone по $uri то edge укладывается по IO.</div><div><br></div><div>Я тут немного переработал конфиг, вышло вот такое, если кому интересно.</div>
<div><br></div><div><div>limit_zone one $binary_remote_addr 64k;</div><div><br></div><div>server {</div><div> listen <a href="http://127.0.0.1:812">127.0.0.1:812</a>;</div><div> server_name _;</div><div><br></div><div>
root /media;</div><div> location / {</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>limit_conn one 1;</div><div> proxy_pass <a href="http://origin">http://origin</a>;</div><div> proxy_ignore_client_abort on;</div>
<div> proxy_store on;</div><div> }</div><div>}</div><div><br></div><div>server {</div><div> listen <a href="http://1.1.1.1:80">1.1.1.1:80</a>;</div><div> server_name _;</div><div><br></div><div> root /media;</div>
<div> location / {</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>internal;</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>aio on;</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>directio 512;</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>output_buffers 1 128k;</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre"> </span>location ~* \.mp4$ {</div><div><span class="Apple-tab-span" style="white-space:pre"> </span> mp4;</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span> try_files $uri @origin;</div><div><span class="Apple-tab-span" style="white-space:pre"> </span> limit_rate_after 1m;</div><div><span class="Apple-tab-span" style="white-space:pre"> </span> limit_rate 200k;</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>}</div><div><span class="Apple-tab-span" style="white-space:pre"> </span> </div><div><span class="Apple-tab-span" style="white-space:pre"> </span>location ~* \.flv$ {</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span> flv;</div><div><span class="Apple-tab-span" style="white-space:pre"> </span> try_files $uri @origin;</div><div><span class="Apple-tab-span" style="white-space:pre"> </span> limit_rate_after 1m;</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span> limit_rate 200k;</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>}</div><div> }</div><div> </div><div> location /dl/ {</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>return 503;</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>location ~ ^/dl/(?P<secure_hash>[\w\-=]+,\d+)(?P<file>/.+)$ {</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span> secure_link $secure_hash;</div><div><span class="Apple-tab-span" style="white-space:pre"> </span> secure_link_md5 $secure_link_expires.$file.<passphrase>;</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span> </div><div><span class="Apple-tab-span" style="white-space:pre"> </span> if ($secure_link = "") {</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>return 403;</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span> }</div><div><span class="Apple-tab-span" style="white-space:pre"> </span> if ($secure_link = 0) {</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>return 403;</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span> }</div><div><span class="Apple-tab-span" style="white-space:pre"> </span> rewrite ^ /$file last;</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>}</div>
<div> }</div><div><br></div><div> location @origin {</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>proxy_pass <a href="http://127.0.0.1:812">http://127.0.0.1:812</a>;</div><div> proxy_ignore_client_abort on;</div>
<div> proxy_intercept_errors on;</div><div> error_page 503 = @stream;</div><div> }</div><div><br></div><div> location @stream {</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>proxy_pass <a href="http://origin">http://origin</a>;</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>proxy_buffering off;</div><div> }</div><div>}</div><div><br></div><br><div class="gmail_quote">2011/10/24 Kruglov Eugenie <span dir="ltr"><<a href="mailto:ekruglov@gmail.com">ekruglov@gmail.com</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"> limit_zone one $binary_remote_addr 64k;<br> server {<br> listen <a href="http://127.0.0.101:812" target="_blank">127.0.0.101:812</a>;<br>
server_name host_stream_store;<br><br> location ~ '^/store/(\d+_(\d+)_[\da-f]{32}\.flv)$' {<br>
limit_conn one 1;<br> proxy_pass <a href="http://remote-backend/$1" target="_blank">http://remote-backend/$1</a>;<br> proxy_store /mnt/storage/streaming/$2.flv;<br> }<br> }<br>
<br> server {<br>
server_name frontend;<br><br> location ~ '^/\d+_(\d+)_[\da-f]{32}\.flv$' {<br> set $args_start $args;<br> if ( -f /mnt/storage/streaming/$1.flv ){<br> rewrite ^ /stream$request_uri last;<br>
}<br> rewrite ^ /stream_store$request_uri last;<br> }<br> location @stream {<br> proxy_pass <a href="http://remote-backend" target="_blank">http://remote-backend</a>$request_uri;<br>
proxy_set_header Host remote-backend;<br>
}<br> location ~ '^/stream_store/(\d+_\d+_[\da-f]{32}\.flv)' {<br> internal;<br> proxy_pass <a href="http://127.0.0.101:812/store/$1" target="_blank">http://127.0.0.101:812/store/$1</a>;<br>
proxy_intercept_errors on;<br>
error_page 503 = @stream;<br> }<br> location ~ ^/stream/\d/\d/([^/]+\.flv)$ {<br> internal;<br> set $args $args_start;<br> alias /mnt/storage/streaming/$1;<br> mp4;<br>
}<br> }<br><br><div class="gmail_quote">2011/10/24 Alexander Moskalenko <span dir="ltr"><<a href="mailto:alexander.moskalenko@gmail.com" target="_blank">alexander.moskalenko@gmail.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div><div></div><div class="h5">
<div class="gmail_quote"><div>2011/10/24 Kruglov Eugenie <span dir="ltr"><<a href="mailto:ekruglov@gmail.com" target="_blank">ekruglov@gmail.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Если устроит реализация, при которой во время работы proxy_store одному клиенту все остальные проксируются на бекенд - могу выложить конфиг.<br><font color="#888888"><br></font></blockquote></div><div>Выкладывайте, возможно хоть подтолкет в нужное направление.</div>
</div>
<br></div></div><div class="im">_______________________________________________<br>
nginx-ru mailing list<br>
<a href="mailto:nginx-ru@nginx.org" target="_blank">nginx-ru@nginx.org</a><br>
<a href="http://mailman.nginx.org/mailman/listinfo/nginx-ru" target="_blank">http://mailman.nginx.org/mailman/listinfo/nginx-ru</a><br></div></blockquote></div><br><br clear="all"><div><div></div><div class="h5"><br>-- <br>
Faithfully yours, Eugenie<br>ICQ #701217<br>
GTalk <a href="mailto:ekruglov@gmail.com" target="_blank">ekruglov@gmail.com</a><br>
</div></div><br>_______________________________________________<br>
nginx-ru mailing list<br>
<a href="mailto:nginx-ru@nginx.org">nginx-ru@nginx.org</a><br>
<a href="http://mailman.nginx.org/mailman/listinfo/nginx-ru" target="_blank">http://mailman.nginx.org/mailman/listinfo/nginx-ru</a><br></blockquote></div><br></div>