Skip to content

Instantly share code, notes, and snippets.

@u007
Last active December 4, 2018 15:41
Show Gist options
  • Save u007/c89688d4e5d31f392bad5a784f5208d6 to your computer and use it in GitHub Desktop.
Save u007/c89688d4e5d31f392bad5a784f5208d6 to your computer and use it in GitHub Desktop.
Caddy vs traefik
www.example.com:80, www.example.com:443 {
tls self_signed
log /logs access.log
errors visible
proxy /assets nginx:80
proxy / web:3000
redir 301 {
if {>X-Forwarded-Proto} is http
/ https://{host}{uri}
}
}
}
#debug = true
[backends]
[backends.buffalo]
[backends.buffalo.loadbalancer.stickiness]
[backends.buffalo.healthcheck]
path = "/healthcheck"
interval = "11s"
[backends.buffalo.servers.server1]
url = "http://web:3000"
[backends.backendNginx]
[backends.backendNginx.loadbalancer.stickiness]
[backends.backendNginx.servers.server1]
url = "http://nginx:80"
[frontends]
[frontends.frontend1]
backend = "buffalo"
[frontends.frontend1.routes.web]
rule = "Host:www.example.com"
entrypoints = ["http","https"]
passHostHeader = true
#passTLSCert = true
priority = 10
[frontends.nginx]
backend = "backendNginx"
[frontends.nginx.routes.web]
rule = "Host:www.example.com;PathPrefix:/assets"
passHostHeader = true
#passTLSCert = true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment