For the complete documentation index, see llms.txt. Markdown versions of all docs pages are available by appending .md to any docs URL.
Rewrites
Verified Code examples on this page have been automatically tested and verified.Rewrite the host or path of a request before agentgateway forwards it to a backend.
Attaches to:
Note
Agentgateway supports more than one configuration style. Where a feature can also be configured in the simplified llm or mcp modes, the examples on this page show each option in tabs. For more information, see Routing-based configuration.
Modify URLs of incoming requests with rewriteRewriteA traffic management feature that modifies the authority (host) or path of requests before forwarding them to backends. policies.
For example, the following configuration modifies the request hostname to example.com and the request path to /new-path.
# yaml-language-server: $schema=https://agentgateway.dev/schema/config
mcp:
port: 3000
policies:
urlRewrite:
authority:
full: example.com
path:
full: /new-path
targets:
- name: everything
stdio:
cmd: npx
args: ["@modelcontextprotocol/server-everything"]