The Envoy HTTP filter chain
Envoy processes every HTTP request through an ordered chain of filters in its HTTP Connection Manager. Filters run in two directions — decode on the way in, encode on the way out — and the chain always ends in the terminal router filter. This reference lists the phases and a catalogue of the most common built-in filters.
How it works
A request flows down the chain through the decode phases, hits the router which forwards it upstream, and the response flows back up through the encode phases in reverse order:
decodeHeaders -> decodeData -> decodeTrailers -> [router] upstream
encodeHeaders <- encodeData <- encodeTrailers <- upstream response
Each filter implements callbacks for these phases and returns a status
(Continue, StopIteration, StopAllIterationAndBuffer) to control flow. Many
filters touch only headers; others buffer the body. Because encode runs in
reverse, ordering matters: place authentication before transcoding, and rate
limiting before the router.
Tips and notes
- The router filter (
envoy.filters.http.router) is terminal and must be last in the chain. - Order auth filters (
jwt_authn,ext_authz,rbac) early so unauthorised requests stop quickly. local_ratelimitis per-instance and dependency-free;ratelimitis global via an external RLS.- Transform filters like
grpc_json_transcoderandwasmsit between auth and the router.