๐ฆ Traefik
Traefik acts as the reverse proxy and dynamic router in the production environment. This document covers core concepts, configuration patterns, and diagnostic procedures.
๐งฉ Core Concepts
- Router โ decides which service handles an incoming request
- Service โ backend target (e.g., a Docker container)
- Middleware โ request/response modifiers (redirects, headers, rate limits)
- EntryPoint โ exposed port (e.g.,
:80,:443)
Routers match requests โ apply middleware โ forward to services.
๐ HTTPS Router Example
1 2 3 4 5 | |
Notes:
websecuretypically maps to port:443certresolver=leenables automatic Let's Encrypt certificates- Host rules support multiple domains and wildcards
๐ ๏ธ Diagnostics & Debugging
๐ Checking Router Health
1 2 | |
๐ Logs
1 | |
Useful for:
- ACME/Let's Encrypt errors
- Router registration issues
- Network connectivity problems
๐ Dashboard
Enable in Traefik configuration:
1 2 | |
Then access:
1 | |
(Requires a router + authentication middleware in production.)
๐จ Common Issues & Solutions
| Problem | Cause | Solution |
|---|---|---|
| 404 from Traefik | Router not created | Check rule= label |
| TLS not working | Missing certresolver | Add tls.certresolver=le |
| Router cannot reach container | Missing network | Add networks: - traefik-net |
| Wrong service port | Incorrect loadbalancer port | Set traefik.http.services.<name>.loadbalancer.server.port= |
| ACME rate limits | Too many cert requests | Reuse certificates, check domain spelling |