Architecture Overview
naati (62,899 lines vs 226,994 lines in NGINX 1.30.8) separates protocol, routing, caching, and supervision logic in Goose from minimal OS and cryptography bindings:
flowchart LR
Client["Clients (HTTP/1.1, HTTP/2, HTTP/3 QUIC, TLS, gRPC, Stream, Mail)"] --> IO["Platform & Crypto Bindings\nio_uring · epoll · UDP GSO · OpenSSL 3 · PCRE2 · zlib"]
IO --> Core["Core Engine (Goose)\nEvent Loop · Protocol Codecs · Config & Reload · Cache · Supervision"]
Core --> SHM["Shared Memory Zones\nCache Keys · TLS Sessions · Limits · Upstream Zones"]
Core --> Up["Upstreams\nHTTP/1.x · HTTP/2 · gRPC · FastCGI · uwsgi · SCGI · Memcached"]
Core Subsystems
- Master/Worker Supervision: A single master parses and validates
nginx.conf, opens listeners and shared-memory zones, and forks isolated workers (plus optional cache manager and cache loader processes).SIGHUPvalidates new configurations before switching workers and drains old workers gracefully (SIGQUIT). Workers drop privileges and disable core dumps; unexpected worker exits log[alert], repair shared-memory state, and respawn cleanly. - Linux I/O Backends: Workers automatically use native Linux
io_uringwith transparent fallback toepollwhenio_uringis unavailable or restricted by container seccomp profiles, plusrecvmmsg/sendmmsgand automatic LinuxUDP_SEGMENT(UDP GSO) for QUIC/HTTP/3. - Protocols & Upstreams: Native HTTP/1.0, HTTP/1.1, HTTP/2, HTTP/3 (QUIC v1), TLS 1.2/1.3 (including opt-in kTLS
SSL_sendfile), built-inbrotli_static, TCP/UDPstream, andmail, backed by a unified upstream engine supporting HTTP/1.x, HTTP/2, gRPC, FastCGI, uwsgi, SCGI, and memcached. - Shared-Memory Zones: Cross-worker rate limits, connection limits, TLS session/OCSP caches, sticky sessions, upstream zones, and HTTP cache indexes use lock-free shared-memory zones with automatic recovery if a worker exits unexpectedly.
See Improvements Over NGINX & Roadmap for a side-by-side comparison against stock NGINX 1.30.8.