Skip to content

Instantly share code, notes, and snippets.

@u007 u007/Caddyfile
Last active Dec 4, 2018

Embed
What would you like to do?
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
You can’t perform that action at this time.