fix: route host loopback backends

This commit is contained in:
Alfredo Di Stasio
2026-06-30 10:16:03 +02:00
parent f3759e76ea
commit 1509c1e5fd
11 changed files with 46 additions and 48 deletions
+5 -5
View File
@@ -31,17 +31,17 @@ tcp:
- address: "host.docker.internal:8443"
```
`HostSNI(...)` matches the hostname sent by the client during the TLS handshake. If a backend listens on the Docker host itself, use `host.docker.internal:PORT`.
`HostSNI(...)` matches the hostname sent by the client during the TLS handshake. This deployment uses host networking so Traefik can reach services bound to the Docker host loopback address, such as `127.0.0.1:8443`.
HTTP-01 certificate challenges use normal HTTP routing on port `80`, not SNI. The included example forwards:
```text
lab.younerd.org/.well-known/acme-challenge/* -> host.docker.internal:8080
azionelab.org/.well-known/acme-challenge/* -> host.docker.internal:9080
www.azionelab.org/.well-known/acme-challenge/* -> host.docker.internal:9080
lab.younerd.org -> 127.0.0.1:8080
azionelab.org -> 127.0.0.1:9080
www.azionelab.org -> 127.0.0.1:9080
```
Adjust `8080` and `9080` to the local ports where the Certbot challenge responder or webroot service is listening.
Adjust `8080` and `9080` to the local ports where the backend HTTP service is listening. The full HTTP request is forwarded so the backend can handle redirects and ACME challenge paths.
## Run