---
title: "Concepts"
language: "en"
documentation_version: "3.x"
channel: "development"
release_context: null
source_revision: "10297d1e28653321d6996609fc53718d3b7c8278"
working_tree_clean: true
source_path: "docs/concepts/README.md"
source_sha256: "4a5e58242c9ad49e21c34b7981e4b13e4f08121b9e7bd84497417bb94b29fd9c"
source_at_revision: true
source_url: "https://github.com/matsumotory/ngx_mruby/blob/10297d1e28653321d6996609fc53718d3b7c8278/docs/concepts/README.md"
html_url: "https://ngx.mruby.org/concepts/"
markdown_url: "https://ngx.mruby.org/markdown/concepts.md"
last_updated: "2026-10-29"
---

# Concepts

These pages explain how ngx_mruby runs Ruby inside nginx: where in the
processing of a request each handler runs, how the filters see a response,
how a handler waits without blocking the worker, and what lives across
requests.

- [Request phases](/concepts/request-phases/): nginx's HTTP phases in order, and
  the ngx_mruby directive that runs Ruby in each of them.
- [Filters](/concepts/filters/): where the header filter and the body filter of
  ngx_mruby stand in nginx's filter chains, and what each one receives.
- [Waiting without blocking](/concepts/async/): how `Nginx::Async.sleep` and
  `Nginx::Async::HTTP.sub_request` give the worker back to nginx.
- [Lifetimes](/concepts/lifetimes/): one `mrb_state` per worker, and what a worker
  keeps between requests.
- [Trust boundary](/security/trust-boundary/): what ngx_mruby trusts,
  what it treats as client input, and what a script is responsible for.
