<html><body><div style="color:#000; background-color:#fff; font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:16px"><div id="yui_3_16_0_1_1434781776946_4000">Hello, I'm John and I'm a nginx noob.</div><div id="yui_3_16_0_1_1434781776946_4000"><br></div><div id="yui_3_16_0_1_1434781776946_4000" dir="ltr">I was wondering how the request limit reach is calculated when using limit_req_zone and limit_req.</div><div id="yui_3_16_0_1_1434781776946_4000" dir="ltr">My problem is that, in development, I'm not concatenating static files such as .js and .css files. And so the browser does about 27 requests when the first page is loaded. I've set up a rate of 50r/s, but out of 27, about 18 requests receive a 503 response and I don't understand why, since the rate isn't exceeded.</div><div id="yui_3_16_0_1_1434781776946_4000" dir="ltr"><br></div><div id="yui_3_16_0_1_1434781776946_4000" dir="ltr">My config looks something like this. I have a link to this from the sites-enabled folder.</div><div id="yui_3_16_0_1_1434781776946_4000" dir="ltr"><br></div><div id="yui_3_16_0_1_1434781776946_4000" dir="ltr" class="" style="">limit_req_zone $binary_remote_addr zone=one:10m rate=50r/s;</div><div id="yui_3_16_0_1_1434781776946_4000" dir="ltr" class="" style=""><br class="" style=""></div><div id="yui_3_16_0_1_1434781776946_4000" dir="ltr" class="" style="">server {</div><div id="yui_3_16_0_1_1434781776946_4000" dir="ltr" class="" style=""> listen 443 ssl; </div><div id="yui_3_16_0_1_1434781776946_4000" dir="ltr" class="" style=""> ssl_certificate ...;</div><div id="yui_3_16_0_1_1434781776946_4000" dir="ltr" class="" style=""> ssl_certificate_key ...;</div><div id="yui_3_16_0_1_1434781776946_4000" dir="ltr" class="" style=""> server_name localhost; </div><div id="yui_3_16_0_1_1434781776946_4000" dir="ltr" class="" style=""> server_tokens off; </div><div id="yui_3_16_0_1_1434781776946_4000" dir="ltr" class="" style=""> gzip_types *;</div><div id="yui_3_16_0_1_1434781776946_4000" dir="ltr" class="" style=""> root ...;</div><div id="yui_3_16_0_1_1434781776946_4000" dir="ltr" class="" style=""><br></div><div id="yui_3_16_0_1_1434781776946_4000" dir="ltr" class="" style=""> limit_req zone=one;</div><div id="yui_3_16_0_1_1434781776946_4000" dir="ltr" class="" style=""><br class="" style=""></div><div id="yui_3_16_0_1_1434781776946_4000" dir="ltr" class="" style=""> location = / { </div><div id="yui_3_16_0_1_1434781776946_4000" dir="ltr" class="" style=""> index index.html;</div><div id="yui_3_16_0_1_1434781776946_4000" dir="ltr" class="" style=""> }</div><div id="yui_3_16_0_1_1434781776946_4000" dir="ltr" class="" style=""><br class="" style=""></div><div id="yui_3_16_0_1_1434781776946_4000" dir="ltr" class="" style=""> location = /index.html {</div><div id="yui_3_16_0_1_1434781776946_4000" dir="ltr" class="" style=""> ...</div><div id="yui_3_16_0_1_1434781776946_4000" dir="ltr" class="" style=""> }</div><div id="yui_3_16_0_1_1434781776946_4000" dir="ltr" class="" style=""><br class="" style=""></div><div id="yui_3_16_0_1_1434781776946_4000" dir="ltr" class="" style=""> location / {</div><div id="yui_3_16_0_1_1434781776946_4000" dir="ltr" class="" style=""> ...</div><div id="yui_3_16_0_1_1434781776946_4000" dir="ltr" class="" style=""> }</div><div id="yui_3_16_0_1_1434781776946_4000" dir="ltr" class="" style="">} </div><div id="yui_3_16_0_1_1434781776946_4000" dir="ltr" class="" style=""><br></div><div id="yui_3_16_0_1_1434781776946_4000" dir="ltr" class="" style="">If I use </div><div id="yui_3_16_0_1_1434781776946_4000" dir="ltr" class="" style="">limit_req_zone $binary_remote_addr zone=one:10m rate=10r/s;</div><div id="yui_3_16_0_1_1434781776946_4000" dir="ltr" class="" style="">with </div><div id="yui_3_16_0_1_1434781776946_4000" class="" style="" dir="ltr">limit_req zone=one burst=50 nodelay;<br></div><div id="yui_3_16_0_1_1434781776946_4000" class="" style="" dir="ltr">it works OK.</div><div id="yui_3_16_0_1_1434781776946_4000" class="" style="" dir="ltr"><br></div><div id="yui_3_16_0_1_1434781776946_4000" class="" style="" dir="ltr">I was wondering why I would have to specify a burst in order for this to work.</div><div id="yui_3_16_0_1_1434781776946_4000" class="" style="" dir="ltr"><br></div><div id="yui_3_16_0_1_1434781776946_4000" class="" style="" dir="ltr">Thank you!</div><div id="yui_3_16_0_1_1434781776946_4000" class="" style=""><br class="" style=""></div></div></body></html>