Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom behavior for the situation when the service has no healthy instances #898

Closed
VladyslavLishchyna opened this issue Jul 26, 2022 · 2 comments

Comments

@VladyslavLishchyna
Copy link

Hello everyone, please forgive me right away if my question is stupid or the answer has already been written before (I can’t find it, but I was looking for it). Is it possible in fabio to set a route to which the request will be redirected if there are no available services?

I mean the situation when services are registered for a certain path, but they have the status "unhealthy". In such a situation, I would like to redirect requests to a static page with information like "technical work is in progress, try again later".

Is there a way to do this with consul+fabio ?

@aaronhurt
Copy link
Member

aaronhurt commented Jul 26, 2022

You can do this using the weight feature ...
Implementation discussion here: #42
Docs here: https://fabiolb.net/cfg/

TLDR: Set w=100 on your consul services and register a fallback with w=0 the 0 service will only get traffic if the others are down.

@VladyslavLishchyna
Copy link
Author

Thanks amazing solution

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants