-
Notifications
You must be signed in to change notification settings - Fork 616
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 status code when no route found #107
Comments
When no route was found fabio returns status code 404 Not Found which may not be suitable in situations where 404 has a valid meaning.
Good point. I've added a patch which adds this feature. Let me know if this works. |
I'm also thinking whether this is something that fabio could do natively. It could determine the fabio instances in another data center and route requests for failed routes there. This would save another roundtrip since fabio knows which routes it has. Can you explain your use case a bit more and which other functions your nginx is serving? |
We use nginx for offloading SSL, ACLs, rewrites and these sorts of more complicated tasks. If fabio were to route to another DC then it would solve another problem we have - where if one microservice fails in DC1 all nginx routes all microservices attached to that upstream to DC2. I'll test your patch next week and let you know. Thanks so much as usual! |
I'm going to merge this one. The change is simple enough. Please re-open if this doesn't work as intended. |
When no route was found fabio returns status code 404 Not Found which may not be suitable in situations where 404 has a valid meaning.
Hi, can confirm this now works! 👍 |
Hi, currently fabio returns a 404 if no route is found.
We have nginx in front that routes a 404 to another fabio instance in DC2 if DC1 service is unavailable. But this causes a problem if a microservice responses with a legitimate 404 in DC1 as the request would be routed twice by nginx.
How could this use case be supported? I was hoping for a custom response code if no route is found, but I could not find anything in the documentation.
The text was updated successfully, but these errors were encountered: