Envoy HTTP Filter Phases

Envoy filter chain phases and well-known HTTP filter names with order.

Reference for the Envoy proxy HTTP filter chain: the decode and encode phases, the terminal router filter, and a catalogue of common built-in HTTP filters such as ext_authz, jwt_authn and ratelimit.

In what order do Envoy HTTP filters run?

On the request (decode) path filters run top to bottom in the order they appear in the chain. On the response (encode) path they run in reverse, bottom to top. So a filter added last sees the response first and the request last.

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_ratelimit is per-instance and dependency-free; ratelimit is global via an external RLS.
  • Transform filters like grpc_json_transcoder and wasm sit between auth and the router.