<div dir="ltr"><span style="font-family:arial,sans-serif;font-size:13px">Hey there,</span><br><div class="gmail_quote"><div dir="ltr"><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">
I've been doing some work using limit_req to prevent overzealous clients from DOS'ing my site. Specifically, I wanted to use a different HTTP status code such as 420 or 429 so that it would be straightforward to show a "hey man, chill out" page rather than my generic 503 error page.</div>

<div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">Attached is a patch that enables this option for the limit_req directive. It still defaults to 503, but you can set it to any 4xx or 5xx value of your choosing by specifying</div>

<div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">limit_req zone=foo burst=10 status_code=420;</div><div style="font-family:arial,sans-serif;font-size:13px">

<br></div><div style="font-family:arial,sans-serif;font-size:13px">for example.</div><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">I hope I've sent this to the right place. Please let me know where else to send it if I'm in the wrong place.</div>

<div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">Cheers,</div><span class="HOEnZb"><font color="#888888"><div><br></div>-- <br><div>Nick Marden</div>
<div><a href="mailto:nick@marden.org" target="_blank">nick@marden.org</a></div></font></span></div></div>
</div>