Nginx blog (which, if you work with Nginx in any capacity, you should subscribe to) has an excellent guide to rate limiting. The article explains rate limiting from the basics, through bursts, all the way to more advanced examples, with multiple rate limits for the same location.