fabio
Consul Load-Balancing made simple
A zero-configuration load balancer and HTTP router that reads service tags from Consul automatically and updates routing rules instantly when services start or stop, with no config file required.
Fabio is a load balancer and HTTP router designed for teams that already use Consul, a service discovery and health-checking tool. The key promise is zero configuration: instead of maintaining routing rules in a config file, fabio reads the service registry in Consul automatically and starts routing traffic to healthy instances. When services start or stop, the routing table updates instantly without restarting fabio.
Getting started follows a short sequence: install fabio, register your services in Consul with a health check, and add a special tag to each service entry in the format urlprefix-/your-path. Fabio reads those tags and builds its routing rules from them. HTTP traffic sent to fabio on port 9999 is then distributed to matching services. TCP proxying is also supported through a separate tag format. No external configuration file is needed unless you want to override defaults.
Beyond basic routing, fabio supports TLS termination with dynamic certificate stores, raw TCP proxying, WebSocket connections, server-sent events, and traffic shaping for blue/green deployment strategies, where you can shift a portion of traffic to a new service version before switching over fully. Metrics can be exported to Prometheus, Graphite, StatsD, DataDog, or Circonus. A built-in web UI shows the current routing table.
The project originated at eBay and has been running in production at gumtree.com.au since September 2015, handling roughly 23,000 requests per second. It also integrates with HashiCorp Vault for secret management and with AWS Elastic Load Balancing and API Gateway. Fabio is available as pre-built binaries, a Docker image, a Homebrew package on macOS, or compiled from Go source. Full documentation is at fabiolb.net.
Where it fits
- Replace static nginx config files with automatic Consul-tag-based routing that updates without restarting the load balancer
- Implement blue/green deployments by shifting a percentage of traffic to a new service version using traffic shaping
- Set up TLS termination and WebSocket proxying for microservices registered in Consul
- Export routing metrics to Prometheus or DataDog to monitor traffic distribution across healthy service instances