Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I would like to set a limit on the number of requests a single client IP address can make to my server, based on their IP address. Nginx has a limit_req_zone directive. However, this directive will actually limit the average hits. If I set my limit to rate=6r/m, it will actually allow only one hit every 10 seconds.

Instead, what I need is an actual limit per minute. E.g. the client should be able to fire 3 or 4 requests quickly after each other or even simultaneously, but not more than e.g. 10 per minute. Is there a way to do this?

share|improve this question

1 Answer 1

Ah I think this can be done with the nodelay setting as decribed at the bottom of the limit_req wiki:

If delaying excess requests within a burst is not necessary, you should use the option nodelay:

limit_req   zone=one  burst=5  nodelay;
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.