Thanks for having a look - appreciated!
traefik.toml
[global]
checkNewVersion = false
sendAnonymousUsage = false
[entryPoints]
[entryPoints.web]
address = ":80"
[entryPoints.web.proxyProtocol]
trustedIPs = ["173.245.48.0/20", "103.21.244.0/22", "103.22.200.0/22", "103.31.4.0/22", "141.101.64.0/18", "108.162.192.0/18", "190.93.240.0/20", "188.114.96.0/20", "197.234.240.0/22", "198.41.128.0/17", "162.158.0.0/15", "104.16.0.0/12", "172.64.0.0/13", "131.0.72.0/22", "2400:cb00::/32", "2606:4700::/32", "2803:f800::/32", "2405:b500::/32", "2405:8100::/32", "2a06:98c0::/29", "2c0f:f248::/32"]
[entryPoints.web.forwardedHeaders]
trustedIPs = ["173.245.48.0/20", "103.21.244.0/22", "103.22.200.0/22", "103.31.4.0/22", "141.101.64.0/18", "108.162.192.0/18", "190.93.240.0/20", "188.114.96.0/20", "197.234.240.0/22", "198.41.128.0/17", "162.158.0.0/15", "104.16.0.0/12", "172.64.0.0/13", "131.0.72.0/22", "2400:cb00::/32", "2606:4700::/32", "2803:f800::/32", "2405:b500::/32", "2405:8100::/32", "2a06:98c0::/29", "2c0f:f248::/32"]
[entryPoints.web_secure]
address = ":443"
[entryPoints.web_secure.proxyProtocol]
trustedIPs = ["173.245.48.0/20", "103.21.244.0/22", "103.22.200.0/22", "103.31.4.0/22", "141.101.64.0/18", "108.162.192.0/18", "190.93.240.0/20", "188.114.96.0/20", "197.234.240.0/22", "198.41.128.0/17", "162.158.0.0/15", "104.16.0.0/12", "172.64.0.0/13", "131.0.72.0/22", "2400:cb00::/32", "2606:4700::/32", "2803:f800::/32", "2405:b500::/32", "2405:8100::/32", "2a06:98c0::/29", "2c0f:f248::/32"]
[entryPoints.web_secure.forwardedHeaders]
trustedIPs = ["173.245.48.0/20", "103.21.244.0/22", "103.22.200.0/22", "103.31.4.0/22", "141.101.64.0/18", "108.162.192.0/18", "190.93.240.0/20", "188.114.96.0/20", "197.234.240.0/22", "198.41.128.0/17", "162.158.0.0/15", "104.16.0.0/12", "172.64.0.0/13", "131.0.72.0/22", "2400:cb00::/32", "2606:4700::/32", "2803:f800::/32", "2405:b500::/32", "2405:8100::/32", "2a06:98c0::/29", "2c0f:f248::/32"]
# beta
# [certificatesResolvers.basic.acme]
# email = "bofh@REDACTED.nl"
# storage = "/etc/traefik/acme/acme.json"
# [certificatesResolvers.basic.acme.httpChallenge]
# entryPoint = "web"
[acme]
email = "bofh@REDACTED.nl"
storage = "/etc/traefik/acme/acme.json"
onHostRule = true # dynamic generation based on the Host() & HostSNI() matchers
[acme.httpChallenge]
entryPoint = "web"
[providers]
[providers.docker]
endpoint = "unix:///var/run/docker.sock"
exposedByDefault = false
defaultRule = "Host(`{{ normalize .Name }}.srv.REDACTED.nl`)"
network = "services"
[providers.file]
filename = "/etc/traefik/dynamic_conf.toml"
(note: I switched back to alpha8 for now)
dynamic_conf.toml
[http]
[http.middlewares]
[http.middlewares.compression.Compress]
# cloudflare whitelist
[http.middlewares.cloudflare_whitelist.ipWhiteList]
sourceRange = ["173.245.48.0/20", "103.21.244.0/22", "103.22.200.0/22", "103.31.4.0/22", "141.101.64.0/18", "108.162.192.0/18", "190.93.240.0/20", "188.114.96.0/20", "197.234.240.0/22", "198.41.128.0/17", "162.158.0.0/15", "104.16.0.0/12", "172.64.0.0/13", "131.0.72.0/22", "2400:cb00::/32", "2606:4700::/32", "2803:f800::/32", "2405:b500::/32", "2405:8100::/32", "2a06:98c0::/29", "2c0f:f248::/32"]
# https redirect
[http.middlewares.https_redirect.redirectscheme]
scheme = "https"
permanent = true
And then I use terraform to spin-up a docker container with the following labels:
labels {
traefik.enable = "true"
traefik.docker.network = "services"
# http-router
traefik.http.routers.jenkins_http.entryPoints = "web"
traefik.http.routers.jenkins_http.rule = "Host(`jenkins.REDACTED.nl`)"
traefik.http.routers.jenkins_http.middlewares = "cloudflare_whitelist@file,https_redirect@file"
# https-router
traefik.http.routers.jenkins_https.entryPoints = "web_secure"
traefik.http.routers.jenkins_https.rule = "Host(`jenkins.REDACTED.nl`)"
traefik.http.routers.jenkins_https.tls = "true"
#traefik.http.routers.jenkins_https.tls.certresolver = "basic"
traefik.http.routers.jenkins_https.middlewares = "cloudflare_whitelist@file,compression@file"
}
(also here I am currently commenting it out because I reverted back to alpha8).
I am not running traefik itself with any docker labels.