lua-resty-upstream-healthcheck
lua-resty-upstream-healthcheck copied to clipboard
Routing requests to all peers when they all down
Sometimes it happens that healthcheckers configuration gets spoiled. For example, when the new version of application has been deployed on the backend servers without respecting healthchecks on the balancer. In this case all peers will be switched to 'DOWN' state and nginx will return 502 error message for incoming requests. If balancer detects such issue it could just switch to default routing of all requests to all peers instead. In theory if all peers are down there is no big reason who shows the error message in situation when we have real problems with all our backend servers.
It is kind of protection from the fool. However, for example AWS application balancer applies it by default.
I have already made a fork and added this feature. You can have a look here: https://github.com/eglinux/lua-resty-upstream-healthcheck So, if you by chance find this way is ok - I can make a pull request. Thanks!
@eglinux Yes, we should do it that way. Just be careful about performance :)
Pull requests welcome! And sorry for my late reply.
Pull request is in place #52
@eglinux Thanks!