Skip to content

Instantly share code, notes, and snippets.

@jdeathe
Created October 25, 2016 22:55
Show Gist options
  • Save jdeathe/7ae7e43c7e7adeda3e7f322b263dcb35 to your computer and use it in GitHub Desktop.
Save jdeathe/7ae7e43c7e7adeda3e7f322b263dcb35 to your computer and use it in GitHub Desktop.
Traefik (front-end/backend) rules configuration example for load balanced containers with front-end https://app-1.local
[backends]
[backends.http-pool-1]
[backends.http-pool-1.circuitbreaker]
expression = "NetworkErrorRatio() > 0.5"
[backends.http-pool-1.maxconn]
amount = 10240
extractorfunc = "request.host"
[backends.http-pool-1.LoadBalancer]
method = "drr"
[backends.http-pool-1.servers.1-1]
url = "http://192.168.98.100:8080"
weight = 10
[backends.http-pool-1.servers.2-1]
url = "http://192.168.98.100:8081"
weight = 10
[backends.http-pool-1.servers.3-1]
url = "http://192.168.98.100:8082"
weight = 10
[backends.https-pool-1]
[backends.https-pool-1.circuitbreaker]
expression = "NetworkErrorRatio() > 0.5"
[backends.https-pool-1.maxconn]
amount = 4096
extractorfunc = "request.host"
[backends.https-pool-1.LoadBalancer]
method = "drr"
[backends.https-pool-1.servers.1-1]
url = "http://192.168.98.100:8580"
weight = 10
[backends.https-pool-1.servers.2-1]
url = "http://192.168.98.100:8581"
weight = 10
[backends.https-pool-1.servers.3-1]
url = "http://192.168.98.100:8582"
weight = 10
[frontends]
[frontends.http-pool-1]
backend = "http-pool-1"
passHostHeader = true
entrypoints = ["http"]
[frontends.http-pool-1.routes.hosts]
rule = "Host:app-1,app-1.local,www.app-1.local"
[frontends.https-pool-1]
backend = "https-pool-1"
passHostHeader = true
entrypoints = ["https"]
[frontends.https-pool-1.routes.hosts]
rule = "Host:app-1,app-1.local,www.app-1.local"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment