-
Notifications
You must be signed in to change notification settings - Fork 7.6k
Description
At the moment it seems to be not possible to apply a rate limit to a upstream server proxy block without that rate limit being applied globally (for that server), this includes the local NGINX cache. I have attempted to use maps and if statements but sadly any variable that could give me a clue if the request is in the local cache does not get populated soon enough as the rate limiting happens very early on.
I would request that the rate limit feature itself be given some type of variable that allows the nginx cache to bypass the rate limit. I would like reverse proxy cache to serve at full speed but the upstream server to have its rate limit applied.
At the moment the only way to get this seems to be running multiple instances of NGINX together. One to do the cache which then has the second as an upstream which applies the ratelimit. I do not think this is that uncommon a scenario where the upstream needs a limit but we are happy to serve what we have in cache as fast as possible.