Re: Max_fails for proxy_pass without an upstream block

2019-05-17 Thread jarstewa
Bumping this thread in the hopes that someone knows the answer. Posted at Nginx Forum: https://forum.nginx.org/read.php?2,284004,284208#msg-284208 ___ nginx mailing list nginx@nginx.org http://mailman.nginx.org/mailman/listinfo/nginx

Max_fails for proxy_pass without an upstream block

2019-05-02 Thread jarstewa
Is there an equivalent of max_fails (http://nginx.org/en/docs/http/ngx_http_upstream_module.html#max_fails) if I'm using proxy_pass without an upstream block? E.g. http { server { resolver 10.0.0.2 valid=5s; set $upstream_server http://foo.bar:80; location ~* \.(html)$ {

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

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

Caching result of auth_request_set?

2018-07-20 Thread jarstewa
I'm currently using the auth_request directive and caching the result based on a guid + IP address: >location /auth { >internal; > >proxy_pass_request_body off; >proxy_pass $upstream_server/auth?id=$guid&requestor=$last_client_ip; > >proxy_cache auth_cache; >set $auth_cache_k

Re: limit_req applied to upstream auth_request requests?

2018-07-18 Thread jarstewa
Maxim Dounin Wrote: --- > The explanation on why it isn't working was in the first paragraph > I wrote: > > : The limit_req directive doesn't try to limit requests already > : limited, as well as subrequests within these requests. You should >

Re: limit_req applied to upstream auth_request requests?

2018-07-17 Thread jarstewa
Maxim Dounin Wrote: --- > Hello! > ... > Note well that this configuration implies that every request to > "/out/..." will generate a subrequest to "/auth". As such, you > can safely move the "limit_req zone=auth ..." limit to "location > /out

limit_req applied to upstream auth_request requests?

2018-07-17 Thread jarstewa
Hi, I currently have an nginx configuration that uses the limit_req directive to throttle upstream content requests. Now I'm trying to add similar rate limiting for auth requests, but I haven't been able to get the auth throttle to kick in during testing (whereas the content throttle works as expe