Re: Throttle requests with limit_req rate based on header from response to auth subrequest

2018-08-31 Thread Francis Daly
On Thu, Aug 30, 2018 at 08:13:33PM -0400, jarstewa wrote: Hi there, For what it's worth: > 1) The limit_req directive is being processed before the auth subrequest > 2) Therefore, when the limit_req is present, the mapped variables are empty > since the header from the auth request is not presen

Re: Throttle requests with limit_req rate based on header from response to auth subrequest

2018-08-30 Thread jarstewa
Hmm, I notice this from the map documentation: > Since variables are evaluated only when they are used, the mere declaration even of a large number of “map” variables does not add any extra costs to request processing. Here is what I suspect: 1) The limit_req directive is being processed befor

Re: Throttle requests with limit_req rate based on header from response to auth subrequest

2018-08-30 Thread jarstewa
Digging into this some more today, I've continued to find what seems to be odd behavior. If I remove all of the limit_req directives, then the mapped variables based on the upstream are always present: { "upstream_http_tier": "", "tier": "02x", "http_tier": "", "key_two": "",

Re: Throttle requests with limit_req rate based on header from response to auth subrequest

2018-08-30 Thread jarstewa
Francis Daly Wrote: --- > On Wed, Aug 29, 2018 at 07:14:01PM -0400, jarstewa wrote: > > Hi there, > > I do not know the answer, and I have not tested the code you provided. > > But, one suggestion which might be quick for you to test: > > what

Re: Throttle requests with limit_req rate based on header from response to auth subrequest

2018-08-30 Thread Francis Daly
On Wed, Aug 29, 2018 at 07:14:01PM -0400, jarstewa wrote: Hi there, I do not know the answer, and I have not tested the code you provided. But, one suggestion which might be quick for you to test: what happens if you change all of your variable names so that they do not start with a digit? As

Throttle requests with limit_req rate based on header from response to auth subrequest

2018-08-29 Thread jarstewa
I'm hoping to use the limit_req directive with different rates based on a header that is returned from the auth subrequest. I got some ideas from https://www.ruby-forum.com/topic/4418040 but am running into a few problems. Here is my configuration: > user nginx; > worker_pro