Set no_fallback at server/location block

Issue #31 new
Jonathan Huot created an issue

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 without no_fallback
  • define a sticky_no_fallback in a location /check block
  • send requests to /www with route=0, they get redirected to other servers if 0 server is down
  • send requests to /check with route=0, they get a 504 response, which tells that 0 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)

  1. Log in to comment