Open-Source Wikis

/

nginx

/

Reference

/

Dependencies

nginx/nginx

Dependencies

NGINX has a small footprint of third-party dependencies. Most are detected at configure time; missing ones simply disable the corresponding feature.

Required (for a useful build)

Dependency Used by Header probe (auto/lib/...) Notes
PCRE or PCRE2 rewrite, map, regex location, if auto/lib/pcre/conf PCRE2 preferred. Without it: no regex anywhere in the config.
zlib gzip, gunzip, gzip_static filters auto/lib/zlib/conf Without it: no compression.
OpenSSL 1.1.1+ TLS, HTTP/2 ALPN, HTTP/3, QUIC auto/lib/openssl/conf Or BoringSSL / LibreSSL with the appropriate compat shim. For QUIC: see ngx_event_quic_openssl_compat.c.

Optional

Dependency Used by Configure flag
libxslt ngx_http_xslt_filter_module --with-http_xslt_module[=dynamic]
libgd ngx_http_image_filter_module --with-http_image_filter_module
libgeoip ngx_http_geoip_module, ngx_stream_geoip_module --with-http_geoip_module
Perl ngx_http_perl_module --with-http_perl_module[=dynamic]
libatomic_ops Atomic ops on platforms without GCC builtins --with-libatomic[=DIR]

Bundled (no external dependency)

The codebase contains its own implementations of:

  • MD5src/core/ngx_md5.{c,h} (used unless OpenSSL provides one)
  • SHA-1src/core/ngx_sha1.{c,h} (fallback)
  • MurmurHashsrc/core/ngx_murmurhash.{c,h}
  • CRC32src/core/ngx_crc32.{c,h}
  • Static Huffman tables for HPACKsrc/http/ngx_http_huff_decode.c, src/http/ngx_http_huff_encode.c
  • QUIC transportsrc/event/quic/
  • QPACKsrc/http/v3/ngx_http_v3_table.c
  • Async DNS resolversrc/core/ngx_resolver.{c,h}

OS dependencies

auto/os/conf selects per-OS code based on uname. Key features it probes for:

Feature Where used
epoll(2) Linux event backend
kqueue(2) FreeBSD / macOS event backend
eventfd(2) Linux AIO + thread-pool wakeup
io_setup(2) (libaio) aio directive on Linux
signalfd(2) Optional in some signal paths
SO_REUSEPORT listen ... reuseport;
EPOLLEXCLUSIVE Thundering-herd-free accept on Linux
accept4(2) Combine accept + non-blocking flag
sendfile(2) Static file response path
splice(2) Some upstream-to-client paths
tee(2) Tee in some pipe paths
TCP_FASTOPEN listen ... fastopen=N;
IP_BIND_ADDRESS_NO_PORT Outgoing connection optimization
eBPF (libbpf-style) QUIC reuseport (Linux)
setaffinity family worker_cpu_affinity

Reading nginx -V

The -V output reports the exact set of dependencies the binary was built against:

$ nginx -V
nginx version: nginx/1.31.0
built by gcc 13.2.0 (Ubuntu 13.2.0-23ubuntu4)
built with OpenSSL 3.4.0 22 Oct 2025
TLS SNI support enabled
configure arguments: --with-http_ssl_module --with-http_v2_module ...

The list of configure arguments is identical to what was passed to ./auto/configure. This is the most reliable way to know what's in any given build.

Build-time detection

auto/feature is the helper that compiles small C snippets to detect a feature. Each auto/lib/<name>/conf script does roughly:

  1. Try the system path; if headers + library exist, set NGX_HAVE_<name> and link flags.
  2. If not, try the user-supplied --with-<name>=DIR.
  3. If still nothing, optionally fall back to a bundled copy (zlib, PCRE) or fail (OpenSSL when SSL was requested).

License compatibility

NGINX is 2-clause BSD. All bundled algorithms (MD5, SHA-1, MurmurHash, etc.) are public-domain or BSD-licensed. The dependencies above are all MIT/BSD/Apache/dual-licensed, except libgd and libgeoip which carry their own permissive licenses.

The Perl XS module's binding code is BSD; embedding Perl pulls in Perl's licensing for that build configuration.

Built by Factory AutoWiki from public repository content. It is a generated preview for codebase exploration, not source-maintained documentation.

Dependencies – nginx wiki | Factory