Patch proposal: allow alternatives to 503 status code in limit_req module

Nick Marden nick at marden.org
Sat Mar 2 02:23:08 UTC 2013


Hey there,

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.

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

limit_req zone=foo burst=10 status_code=420;

for example.

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.

Cheers,

-- 
Nick Marden
nick at marden.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx-devel/attachments/20130301/dae365e6/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: alternative_limit_req_status_code.patch
Type: application/octet-stream
Size: 2375 bytes
Desc: not available
URL: <http://mailman.nginx.org/pipermail/nginx-devel/attachments/20130301/dae365e6/attachment.obj>


More information about the nginx-devel mailing list