Welcome! Log In Create A New Profile

Advanced

limit_req based on custom code

February 08, 2017 12:14PM
Hi
I'm evaluating nginx to act as rate limiter for a multi tenancy REST API system. I need to limit API calls by tenant-id.
For example i want to allow 100 r/s for tenant1 and only 50 r/s for tenant2.

It can be easily achived when there are differant urls like: "me.com/tenant1/api" and "me.com/tenant2/api" (with the location directive).

But, in my case the urls are the same for all tenants "me.com/api" (I can't change this).
To find the tenant-id I need to extract a JSON attribute from the Body of the request, and then check the DB for the real tenant-id.

Is it possible to limit_req with my requirements?


Thank for the help!
Subject Author Posted

limit_req based on custom code

yarix February 08, 2017 12:14PM

Re: limit_req based on custom code

yarix February 23, 2017 08:55AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 116
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready