← Back to headers
HTTP Header
Max-Forwards
RequestLimits the number of times a request can be forwarded by proxies or gateways.
HTTP header reference, syntax, examples, and developer usage.
What is the Max-Forwards header?
The Max-Forwards HTTP header is used to transmit metadata between a client and server as part of HTTP requests or responses.
HTTP headers define how content should be interpreted, cached, authenticated, secured, or processed by browsers and APIs.
Direction
This is a request header sent by the client to the server.
Syntax
Max-Forwards: <integer>
Example
Max-Forwards: 10
Common use cases
- Preventing infinite forwarding loops in proxy chains
- Debugging request routing with TRACE requests
- Limiting hop count in OPTIONS requests
Common mistakes
- Using the header in the wrong request or response context
- Sending invalid header values
- Incorrect header syntax
- Assuming the header automatically changes server behaviour
Practical developer insight
Max-Forwards is primarily used with TRACE and OPTIONS methods. Each proxy decrements the value by 1 and must not forward the request when it reaches 0. Rarely needed in modern application code but useful for diagnosing proxy chains.