<div>Hello</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div>firstly i would like to say i love nginx and have recently finished moving from lighttpd!</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div>here is my request if possible please&nbsp;im currently using php and nginx for a huge site using ~2gbit average across several dozen servers with serving large files to thousands of people concurrently</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div>each request goes thru php which does a bit of authentication and concurrency control, it be nice if some of this could be shifted to nginx</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div>currently X-Accel-Redirect&nbsp; works like a charm and has resume support which is very nice</div>
<div>also the X-Accel-Limit-Rate is very useful</div>
<div>&nbsp;</div>
<div>i also pass X-Session-ID header using an id generated via php to make it easier to parse access logs later</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div>now the problem i have is with NginxHttpLimitZoneModule</div>
<div>&nbsp;</div>
<div>is there any way make this more flexible like</div>
<div>&nbsp;</div>
<div>create an extra X-Accel-Limit-Connections header</div>
<div>&nbsp;</div>
<div>that will allow the number of connections to a certain file be set dynamically from php</div>
<div>&nbsp;</div>
<div>for example something like</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div>--------------</div>
<div>&lt;?php</div>
<div>...</div>
<div>header( &#39;Content-Type: &#39;.$download[&#39;file_mime&#39;] );<br>header( &#39;Content-Length: &#39;.$download[&#39;file_size&#39;] );<br>header( &#39;X-Session-ID: &#39;.$download_key );</div>
<div>header( &#39;X-Accel-Limit-Rate: &#39;.$download[&#39;transfer_limit&#39;] );<br>header( &#39;X-Accel-Redirect: /_downloads/&#39;.$download_key );</div>
<div>&nbsp;</div>
<div>//NEW OPTION! limit connections dynamicaly</div>
<div>header( &#39;X-Accel-Limit-Connections: 4&#39;);</div>
<div>&nbsp;</div>
<div>?&gt;</div>
<div>-----<br></div>
<div>&nbsp;</div>
<div>so the above would serve a file of certain mime and size using accel redirect, limiting to certain speed and #&nbsp;connections, and using a session id for custom&nbsp;loging</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div>Thanks<br></div>
<div class="gmail_quote">On Fri, Jun 13, 2008 at 8:36 AM, Igor Sysoev &lt;<a href="mailto:is@rambler-co.ru">is@rambler-co.ru</a>&gt; wrote:<br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">On Fri, Jun 13, 2008 at 03:19:27PM +0800, Cherife Li wrote:<br><br>&gt; On 06/13/08 13:32, mike wrote:<br>
&gt; &gt;You have it.<br>&gt; &gt;<br>&gt; &gt;X-Accel-Redirect.<br>&gt; &gt;<a href="http://wiki.codemongers.com/NginxXSendfile" target="_blank">http://wiki.codemongers.com/NginxXSendfile</a><br>&gt; OK. I&#39;ve got this issue, too.<br>
&gt; The situation is, I dynamical generate data, rather than output solid<br><br>With X-Accel-Redirect you may redirect request to proxied/FastCGI locations.<br><br>&gt; files. And, not sure X-Accel-Redirect module supports regex or directory<br>
&gt; level match, something like lighttpd does.<br><br>Could you show example of regex or directory level match ?<br><font color="#888888"><br><br>--<br>Igor Sysoev<br><a href="http://sysoev.ru/en/" target="_blank">http://sysoev.ru/en/</a><br>
<br></font></blockquote></div><br>