<div>Hello</div>
<div> </div>
<div> </div>
<div>firstly i would like to say i love nginx and have recently finished moving from lighttpd!</div>
<div> </div>
<div> </div>
<div>here is my request if possible please 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> </div>
<div> </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> </div>
<div> </div>
<div>currently X-Accel-Redirect 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> </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> </div>
<div> </div>
<div>now the problem i have is with NginxHttpLimitZoneModule</div>
<div> </div>
<div>is there any way make this more flexible like</div>
<div> </div>
<div>create an extra X-Accel-Limit-Connections header</div>
<div> </div>
<div>that will allow the number of connections to a certain file be set dynamically from php</div>
<div> </div>
<div>for example something like</div>
<div> </div>
<div> </div>
<div>--------------</div>
<div><?php</div>
<div>...</div>
<div>header( 'Content-Type: '.$download['file_mime'] );<br>header( 'Content-Length: '.$download['file_size'] );<br>header( 'X-Session-ID: '.$download_key );</div>
<div>header( 'X-Accel-Limit-Rate: '.$download['transfer_limit'] );<br>header( 'X-Accel-Redirect: /_downloads/'.$download_key );</div>
<div> </div>
<div>//NEW OPTION! limit connections dynamicaly</div>
<div>header( 'X-Accel-Limit-Connections: 4');</div>
<div> </div>
<div>?></div>
<div>-----<br></div>
<div> </div>
<div>so the above would serve a file of certain mime and size using accel redirect, limiting to certain speed and # connections, and using a session id for custom loging</div>
<div> </div>
<div> </div>
<div>Thanks<br></div>
<div class="gmail_quote">On Fri, Jun 13, 2008 at 8:36 AM, Igor Sysoev <<a href="mailto:is@rambler-co.ru">is@rambler-co.ru</a>> 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>> On 06/13/08 13:32, mike wrote:<br>
> >You have it.<br>> ><br>> >X-Accel-Redirect.<br>> ><a href="http://wiki.codemongers.com/NginxXSendfile" target="_blank">http://wiki.codemongers.com/NginxXSendfile</a><br>> OK. I've got this issue, too.<br>
> 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>> files. And, not sure X-Accel-Redirect module supports regex or directory<br>
> 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>