Hey!
So I've been trying to setup a localhost Traefik to server Traefik instance.
I'm trying to send a HTTP request to a localhost DNS to route to a whoami web server at the server backend to read headers. Both instances are running on Docker images with Docker Compose.
Localhost Traefik config
insecureSkipVerify = true
[entryPoints]
[entryPoints.http]
address = ":80"
[entryPoints.https]
address = ":443"
[entryPoints.https.tls]
[entryPoints.https.tls.ClientCA]
files = ["/var/certs/cert.pem"]
optional = true
[[entryPoints.https.tls.certificates]]
certFile = "/var/certs/cert.pem"
keyFile = "/var/certs/key.pem"
[file]
[frontends]
[frontends.frontend1]
backend = "backend1"
[frontends.frontend1.routes.test_1]
rule = "Host:test.localhost"
[frontends.frontend1.passTLSClientCert]
pem = true
[backends]
[backends.backyard]
[backends.backyard.servers.server1]
url = "https://example.com"
weight = 10
Server Traefik config
insecureSkipVerify = true
[entryPoints]
[entryPoints.http]
address = ":80"
[entryPoints.https]
address = ":443"
[entryPoints.https.tls]
[entryPoints.https.tls.ClientCA]
files = ["/certs/cert.pem"]
optional = false
[[entryPoints.https.tls.certificates]]
certFile = "/certs/cert.pem"
keyFile = "/certs/key.pem"
Here's a diagram, hopefully this is clear enough.
Every time I send a GET request to https://test.localhost
I should get to https://example.com
through the two Traefik instances. But I keep getting a 502 bad certificate error coming from the receiving Traefik instance. I suspect that the certificates aren't getting validated on the server end.
Is there a way this can be done with Traefik V1 or V2? Or if it's even possible?