Skip to content

Instantly share code, notes, and snippets.

@eldondev
Created January 12, 2017 06:16
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eldondev/4b3cd28bd77b8046ce792edeb5011345 to your computer and use it in GitHub Desktop.
Save eldondev/4b3cd28bd77b8046ce792edeb5011345 to your computer and use it in GitHub Desktop.
A Treafik configuration file with let's encrypt, https redirection, and hot reloading.
graceTimeOut = 10
traefikLogsFile = "log/traefik.log"
accessLogsFile = "log/access.log"
logLevel = "INFO"
defaultEntryPoints = ["http", "https"]
onDemand = true
OnHostRule = true
[entryPoints]
[entryPoints.http]
address = ":80"
[entryPoints.http.redirect]
entryPoint = "https"
[entryPoints.https]
address = ":443"
[entryPoints.https.tls]
[acme]
email = "it@blargh.org"
storageFile = "acme.json"
onDemand = true
entryPoint = "https"
[[acme.domains]]
main = "wiki.blargh.org"
sans = ["www.blargh.org", "blargh.org"]# Entrypoints definition
[[acme.domains]]
main = "wiki.blargh.org"
sans = ["www.blargh.org", "blargh.org"]# Entrypoints definition
[frontends]
[frontends.frontend1]
entrypoints = ["http", "https"]
backend = "backend1"
[frontends.frontend1.routes.test_1]
rule = "HostRegexp: {[a-z]*}.blargh.{com|org},blargh.{com|org}"
[frontends.frontend2]
entrypoints = ["http", "https"]
backend = "backend1"
[frontends.frontend2.routes.test_2]
rule = "HostRegexp: {[a-z]*}.blargh.{com|org},blargh.{com|org}"
passHostHeader = true
[backends]
[backends.backend1]
[backends.backend1.circuitbreaker]
expression = "NetworkErrorRatio() > 0.5"
[backends.backend1.servers.server1]
url = "http://127.0.0.1:8080"
[web]
address = ":9090"
[file]
watch = true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment