Web / Traefik Interview questions
Explain the execution flow of a request through Traefik's router, middleware, and service chain?
A request first arrives at an entrypoint, the listening port and protocol Traefik was configured to accept traffic on. If the entrypoint terminates TLS, the handshake, including SNI-based certificate selection, happens here before anything else.
Traefik then evaluates the routers attached to that entrypoint, matching the request against each router's rule and, among any that match, selecting the one with the highest priority.
The winning router's middleware chain executes next, in the exact order configured; each middleware can modify the request, add or strip headers, reject it outright (an auth failure, a rate limit), or pass it through unchanged to the next one.
If the request survives the chain, it reaches the router's service, which selects a backend instance according to its load-balancing algorithm and forwards the request; the response then flows back through any response-modifying middlewares (like Headers or Compress) before reaching the client.
More Related questions...