-
Notifications
You must be signed in to change notification settings - Fork 616
Quickstart
This is how you use fabio in your setup:
-
Register your service in consul.
Make sure that each instance registers with a unique ServiceID and a service name without spaces.
-
Register a health check in consul as described here.
Make sure the health check is passing since fabio will only watch services which have a passing health check.
-
Register one
urlprefix-
tag perhost/path
prefix it serves, e.g.:
# HTTP/S examples
urlprefix-/css # path route
urlprefix-i.com/static # host specific path route
urlprefix-mysite.com/ # host specific catch all route
urlprefix-/foo/bar strip=/foo # path stripping (forward '/bar' to upstream)
urlprefix-/foo/bar proto=https # HTTPS upstream
urlprefix-/foo/bar proto=https tlsskipverify=true # HTTPS upstream and self-signed cert
# TCP examples
urlprefix-:3306 proto=tcp # route external port 3306
Make sure the prefix contains at least one slash (/
).
See the full list of options in the Documentation.
-
Start fabio without a config file (assuming a running consul agent on
localhost:8500
) Watch the log output how fabio picks up the route to your service. Try starting/stopping your service to see how the routing table changes instantly.Check Docker Support to see how to run fabio inside a docker container.
-
Send all your HTTP traffic to fabio on port
9999
-
Done
To start a sample server to test the routing run the demo/server
like this:
./server -addr 127.0.0.1:5000 -name svc-a -prefix /foo
and access the server direct and via fabio
curl 127.0.0.1:5000/foo # direct
curl 127.0.0.1:9999/foo # via fabio
fabio can terminate TLS connections and handle client certificate authentication. Check the documentation on Certificate Stores for details.
Check the Debugging section to test how fabio routes requests.
Check the Features page for a full list of features.
Check out fabio.properties for a full list of config options.
Last but not least have fun :)
Frank
- Home
- Quickstart
- Installation
- Verifying Releases
- Configuration
- Binding to low ports
- Deployment
-
Features
- Access Logging ⭐️
- Certificate Stores
- Compression
- Circonus Support
- DataDog Support
- Docker Support
- Dynamic Reloading
- Graceful Shutdown
- Graphite Support
- HTTP Header
- HTTPS Upstream
- Metrics Support
- Path Stripping
- PROXY Protocol
- Request Debugging
- Request Tracing
- SSE Support
- StatsD Support
- TCP Proxy ⭐️
- TCP+SNI Support
- Traffic Shaping
- Vault Integration
- Websockets
- Web UI
- Performance
- Service Configuration
- Routing
- Debugging
- Contributing
- Why fabio?