Skip to content

Instantly share code, notes, and snippets.

@joshualyon
Created March 29, 2020 16:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joshualyon/f5ae2193983a9d72cc6cbfe2d458885c to your computer and use it in GitHub Desktop.
Save joshualyon/f5ae2193983a9d72cc6cbfe2d458885c to your computer and use it in GitHub Desktop.
Example snippet of traefik configuration file
defaultEntryPoints = ["http", "https"]
[entryPoints]
[entryPoints.http]
address = ":80"
[entryPoints.https]
address = ":443"
[entryPoints.https.tls]
[[entryPoints.https.tls.certificates]]
certFile = """-----BEGIN CERTIFICATE-----
MY-SSL-CERT-FILE-HERE
-----END CERTIFICATE-----"""
keyFile = """-----BEGIN PRIVATE KEY-----
MY-SSL-PRIVATE-KEY-HERE
-----END PRIVATE KEY-----"""
# There are other ways of handling the SSL like setting up
# LetsEncrypt which is probably what I will move to. I
# already had an SSL cert from my Apache setup, so I just
# used it here.
# You can also reference the file directly from your file
# system, but I had some trouble getting the reference to
# work so I just put the content directly into the Traefik
# toml file
[web]
address = ":8080"
dashboard = true
[ping]
[file]
[backends]
[backends.mycoolapp]
[backends.mycoolapp.servers.primary]
url = "http://10.0.3.1:7878/internalapppath"
[frontends]
[frontends.mycoolapp]
backend = "mycoolapp"
[frontends.mycoolapp.routes.default]
rule = "PathPrefix:/externalappname"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment