Mark upstream proxy inoperable based on response body or arbitrary http status?
nginx-forum at nginx.us
Wed Aug 8 19:37:36 UTC 2012
I just started playing with Nginx. My goal is to rate limit requests to
a set of backend proxies, and it looks like I want to do this using the
modules HttpUpstreamModule, HttpProxyModule, and HttpLimitReqModule
I see that HttpUpstreamModule marks an upstream server as inoperable
based on the setting of proxy_next_upstream. However, I need to be able
to mark a server as inoperable given conditions that I don't appear to
be able to set. Specifically, if I could examine the results of a server
response and mark it inoperable, or operable, based on the contents,
that'd be best. Another, possibly less complicated solution would be for
me to mark a server inoperable if the http status in the response is
302, but I don't see a "http_302" for proxy_next_upstream.
It would also be great if the amount of time before re-checking a server
marked as inoperable was configurable separate from HttpUpstreamModule's
fail_timeout (so I could say something like, if a server fails once in 1
second mark it inoperable, but don't try to check it again for 3
Am I overlooking options to do what I want to do here?
Posted at Nginx Forum: http://forum.nginx.org/read.php?2,229472,229472#msg-229472
More information about the nginx