Set no_fallback at server/location block
Issue #31
new
Sometime it can be useful to know the actual state of a server by sending a request to route=<key>
.
It's possible if we enable no_fallback
in the upstream
block, but it affects all requests.
So, I'm suggesting to add a sticky_no_fallback
at a localtion
block which allows scenario below :
- define a
sticky
upstream withoutno_fallback
- define a
sticky_no_fallback
in alocation /check
block - send requests to
/www
withroute=0
, they get redirected to other servers if0
server is down - send requests to
/check
withroute=0
, they get a 504 response, which tells that0
server is down
Full example of nginx configuration:
upstream pool {
sticky name=route hash=index path=/;
server localhost4:8888;
server localhost4:9999;
}
server {
listen 4132;
location /check {
sticky_no_fallback;
proxy_pass http://pool;
}
location / {
proxy_pass http://pool;
}
}
Comments (1)
-
reporter - Log in to comment
I've implemented the behavior described above. Please see https://github.com/thomsonreuters/nginx-sticky-module-ng/commit/553fba8440c8db7d2cd7a14da527b548962757df
Also, it seems I'm not able to create PR on this project, when I click "New Pull requests", I got "Permission denied" from Bitbucket.