---
title: "Documents"
language: "en"
documentation_version: "3.x"
channel: "development"
release_context: null
source_revision: "e8643df33306db8d3eb3e9db5077c9dbd1734c0c"
working_tree_clean: true
source_path: "docs/README.md"
source_sha256: "31fd1c49cc69b78c145d6c0393bf7489e729be70b43cd27d8bb8a551e69c6ddb"
source_at_revision: true
source_url: "https://github.com/matsumotory/ngx_mruby/blob/e8643df33306db8d3eb3e9db5077c9dbd1734c0c/docs/README.md"
html_url: "https://ngx.mruby.org/docs/"
markdown_url: "https://ngx.mruby.org/markdown/docs.md"
last_updated: "2026-11-02"
---

# Documents

<a id="documents"></a>

Build request policies in Ruby inside nginx. These pages describe the
**v3 development branch `next`**: implemented behavior and planned work are
kept separate. For the released 2.7 line, use the [stable documentation](https://ngx.mruby.org/v2/).

## Try a working example

- [Model routing with local mocks](/start/#model-routing):
  choose an upstream by model, verify credential replacement, then edit the
  Ruby mapping and send the same request again. No provider key is needed.
- [Install](/guides/install/): build the module for your own nginx, with the
  requirements, build options and upgrade checks.

## Add a policy to your application

- [Model API relay](/guides/agent-proxy/): client-key checks, model routing,
  concurrency limits and streamed relay. Each planned extension is marked.
- [HTTP routing](/guides/routing/): select a backend from request data.
- [Access control](/guides/access-control/): refuse clients on a local denylist.
- [Rate limits](/guides/rate-limit/): apply a limit per API key.
- [Response filters](/guides/body-filter/): modify a response body.
- [TCP connections](/guides/tcp/): check the client before relaying a connection.
- [MCP gateway design](/guides/mcp-gateway/): an unverified architecture,
  with its missing evidence and boundaries stated explicitly.
- [Planned gateway and site access uses](/guides/edge-control/): MCP policy and client profiles,
  model API fallback, AI crawler requests, and cache/telemetry boundaries for v3.
- [Glossary](/glossary/): the terms these pages use for models, model APIs,
  agents, MCP, A2A, their traffic and the AI gateway.

## Look up an API or build option

- [Directives](/reference/directives/): where nginx calls Ruby and how to configure it.
- [Ruby classes and methods](/reference/ruby/): the API available to handlers.
- [Build reference](/reference/build/): compile options and bundled gems.

## Understand the request lifecycle

- [Request phases](/concepts/request-phases/): the order of handlers.
- [Filters](/concepts/filters/): headers, body chunks and their constraints.
- [Waiting without blocking](/concepts/async/): yielding work to nginx.
- [Lifetimes](/concepts/lifetimes/): request-owned and shared worker state.

## Operate and upgrade

- [Release notes](/releases/): read behavior changes before upgrading.
- [Migration from 2.x](/releases/migration/): changes required for v3.
- [Trust boundary](/security/trust-boundary/): what the module and each script must validate.
- [Security policy](/security/): supported releases and private vulnerability reporting.

## Contribute or follow development

- [Contributing](/contributing/): scope, review and contribution steps.
- [Testing](/contributing/test/): the test suites and how to run them.
- [Development procedure](/contributing/development/): branch workflow and shared handoffs.
- [Current work](/contributing/handoff/): the dated queue and public checkpoints.
- [Branch strategy](https://github.com/matsumotory/ngx_mruby/blob/next/README.md#branch-strategy): maintenance and development lines.
- [Other use cases](/guides/use-cases/): additional examples, with their context.

## License

ngx_mruby is distributed under the [MIT License](https://github.com/matsumotory/ngx_mruby/blob/next/MITL).
