Limit_req_status code less than 400

Maxim Dounin mdounin at
Mon Oct 28 18:17:57 UTC 2013


On Mon, Oct 28, 2013 at 11:51:42AM -0200, Guido Accardo wrote:

> Hi everyone,
> I'm configuring nginx's module HttpLimitReqModule to limit requests at 2K
> r/s. I realize that this module only can return codes between 400 and 599
> and as in my team we are developing Real Time Bedding we need to response
> http 204 No Content to those requests that exceeds our limit. Since this
> seems impossible to do by configuring nginx in a different way I'm planning
> to modify the code. Could you give me an idea in which parts of the code
> should I look at in order to modify them?

There is no need to modify the code, just use error_page 

error_page 503 = /empty;

location = /empty {
    return 204;

Maxim Dounin

More information about the nginx-devel mailing list