NGINX functions as an open-source web server, reverse proxy, load balancer, API gateway, and content cache, designed to efficiently handle a large number of concurrent connections. It is widely used for serving websites, distributing application traffic, terminating TLS connections, and managing communication between backend services.
The mainline branch is the actively developed release branch of NGINX Open Source. Unlike the stable branch, it receives new features alongside bug fixes and security updates. This makes it ideal for administrators and developers who wish to access the latest NGINX features without waiting for them to reach a stable release.
NGINX utilizes an asynchronous, event-driven architecture, rather than creating a separate process or thread for each connection. Its master-worker process model allows the system to handle high volumes of data traffic while maintaining efficient resource utilization.
Download Nginx Mainline release-1.31.9 - Software Mirrors |
|---|
Nginx Mainline release-1.31.9 Source Code |
Nginx Mainline release-1.31.9 Release Notes:nginx-1.31.9 mainline version has been released, with vulnerability fixes for use-after-free in resolver (CVE-2026-123634), memory corruption in HTTP/2 flow control (CVE-2026-123007), use-after-free in HTTP/3 (CVE-2026-121810), use-after-free in HTTP/2 (CVE-2026-123633), infinite loop while reading client request body over TLS 1.3 (CVE-2026-118899), use-after-free in mail proxy module (CVE-2026-113425), NULL pointer dereference when using PROXY protocol version 2 (CVE-2026-120993), buffer overflow when using alias with try_files (CVE-2026-125283), SNI bypass in client certificate validation in stream module (CVE-2026-120967), and insufficient validation in stream ssl_preread module (CVE-2026-123640). See official CHANGES on nginx.org. Below is a release summary generated by GitHub. What's Changed
New Contributors
Full Changelog: release-1.31.8...release-1.31.9 |
Features
High-Performance Web Server
NGINX can serve static content such as HTML, CSS, JavaScript, images, and downloadable files directly. Its event-driven architecture is designed to handle thousands of simultaneous connections efficiently.
Supported capabilities include:
HTTP/1.0, HTTP/1.1, HTTP/2, and HTTP/3.
Static file serving.
Virtual hosts and server blocks.
Directory indexing and custom error pages.
MIME type handling.
Request and response header manipulation.
Gzip compression.
Byte-range requests.
Access and error logging.
It can operate as a standalone web server or serve as the front end for dynamic applications.
Reverse Proxy
NGINX is particularly useful as a reverse proxy for applications running behind it. It receives incoming requests and forwards them to the appropriate backend service without exposing those services directly to the internet.
Its reverse-proxy capabilities include:
HTTP and HTTPS proxying.
Request and response header modification.
WebSocket proxying.
Backend connection management.
Request and response buffering.
Proxy timeouts and retry handling.
Upstream connection keepalive.
Passive failure detection.
It works with application servers such as PHP-FPM, Node.js, Python, Java, and Go.
Load Balancing
NGINX distributes incoming traffic across multiple backend servers to improve availability and resource utilization.
Available load-balancing methods include:
Round Robin.
Least Connections.
IP Hash.
Generic Hash.
Least Time, available in NGINX Plus.
Administrators can configure upstream groups, assign server weights, define backup servers, and control connection limits.
The open-source edition supports passive health checks through parameters such as max_fails and fail_timeout. Active health checks and additional advanced monitoring capabilities are available in NGINX Plus.
Content Caching
NGINX includes a flexible caching system that reduces backend workload and improves response times.
Its proxy cache stores responses from upstream servers on disk. Administrators can control caching behavior through configuration directives.
Important capabilities include:
Configurable cache paths and storage zones.
Cache expiration and validity rules.
Cache bypass and no-cache conditions.
Cache locking to reduce duplicate requests.
Background cache updates.
Stale response serving.
Custom cache keys.
Cache purging through supported modules or extensions.
This makes NGINX useful for websites and APIs that need to reduce repeated requests to application servers.
SSL and TLS Termination
NGINX supports HTTPS and can handle TLS encryption before forwarding requests to backend applications.
Features include:
TLS certificate and private key configuration.
SNI support.
HTTP-to-HTTPS redirection.
TLS protocol and cipher configuration.
OCSP stapling.
Session caching and session tickets.
Client certificate authentication.
HTTPS connections to upstream servers.
This allows administrators to centralize certificate management and encryption settings instead of configuring TLS independently for every backend application.
HTTP/2 and HTTP/3
NGINX supports modern HTTP protocols to improve communication between clients and servers.
HTTP/2 provides multiplexing, header compression, and more efficient request handling over a single connection.
HTTP/3 uses QUIC over UDP and can improve connection establishment and performance under certain network conditions.
The mainline branch is particularly relevant for users who want the latest protocol improvements and related bug fixes. HTTP/3 requires an appropriate build configuration and compatible TLS library.
TCP and UDP Load Balancing
The Stream module extends NGINX beyond HTTP traffic by providing TCP and UDP proxying.
It can distribute connections to databases, mail servers, DNS services, and other network applications.
Supported capabilities include:
TCP proxying.
UDP proxying.
TCP and UDP load balancing.
SSL/TLS termination for supported stream configurations.
SNI-based routing.
PROXY protocol support.
Connection timeouts and limits.
Upstream server selection.
This makes NGINX useful as a general-purpose network traffic gateway rather than exclusively a web server.
Mail Proxy
NGINX includes a mail proxy module for handling connections to IMAP, POP3, and SMTP servers.
It can authenticate users through an external HTTP authentication service and proxy connections to backend mail servers.
This is useful for organizations that want to centralize mail connection handling and authentication.
Access Control and Security
NGINX provides several mechanisms for controlling access to websites and backend services.
These include:
IP-based access restrictions.
Basic HTTP authentication.
Client certificate verification.
Request rate limiting.
Connection limiting.
Request body size restrictions.
URL and location-based access rules.
Security-related response headers.
Request filtering and routing rules.
Its modular architecture also allows administrators to extend functionality with third-party modules, although external modules should be reviewed carefully for compatibility and security.
Modular Architecture and Extensibility
NGINX uses a modular architecture that allows administrators to enable additional functionality during compilation or load supported dynamic modules at runtime.
Common modules cover HTTP authentication, compression, image filtering, geographic IP handling, real IP processing, stream proxying, mail proxying, and other capabilities.
NGINX also supports NGINX JavaScript (njs), a module that extends its functionality with JavaScript-based scripting for HTTP and Stream processing.
Dynamic modules are useful when you want to extend an existing installation without rebuilding the entire executable, provided the module is compatible with the installed NGINX build.
Configuration and Process Management
NGINX uses a master process and worker processes. The master process manages configuration and worker lifecycle, while workers handle incoming connections.
Its configuration system supports reusable directives, nested contexts, variables, conditional processing, and configuration file inclusion.
Useful administrative commands include:
nginx -t
nginx -T
nginx -s reload
nginx -s quit
nginx -s stopThe configuration test command checks syntax and attempts to open referenced files. Reloading applies configuration changes without requiring a full service restart.
Performance and Compatibility
NGINX is written in C and uses an event-driven, non-blocking architecture. Its worker processes can handle multiple connections concurrently, making it suitable for high-traffic web servers and reverse-proxy deployments.
Performance depends on several factors, including CPU resources, available memory, network throughput, TLS configuration, connection patterns, and backend response times.
Its main performance characteristics include:
Event-driven connection processing.
Multiple worker processes.
Asynchronous I/O.
Efficient static file delivery.
Connection keepalive.
Configurable buffering.
Proxy and content caching.
Optional CPU affinity and worker tuning.
NGINX supports Linux, FreeBSD, macOS, and other Unix-like operating systems. Windows executables are also available, but the Windows implementation remains limited and is intended primarily for development and testing rather than high-performance production deployments.
The mainline branch receives new features and improvements more frequently than Stable. This provides earlier access to functionality and fixes, but also means administrators should test upgrades and configuration changes before deploying them to critical infrastructure.
NGINX Open Source is distributed under the BSD 2-Clause License.
System Requirements
NGINX has relatively modest baseline requirements and can run on small virtual machines as well as large production servers.
Supported platforms:
Linux distributions.
FreeBSD and other supported Unix-like systems.
macOS.
Windows for development and testing.
Build requirements:
C compiler.
Make utility.
PCRE2 or compatible PCRE library for regular-expression support.
zlib for gzip compression.
OpenSSL for SSL/TLS support.
Additional development libraries depending on enabled modules.
Optional dependencies are not mandatory for every build. A minimal HTTP server, for example, can be compiled without enabling every available module.
Pros and Cons
Pros
High-performance event-driven architecture.
Efficient handling of concurrent connections.
Latest features and improvements arrive through mainline releases.
Excellent reverse-proxy capabilities.
Built-in HTTP load balancing.
Flexible proxy and content caching.
HTTP/2 and HTTP/3 support.
TCP and UDP proxying through the Stream module.
SSL/TLS termination and certificate management.
Extensive configuration and modular architecture.
Supports NGINX JavaScript extensions.
Low baseline resource consumption.
BSD 2-Clause open-source license.
Cons
Configuration syntax can be difficult for beginners.
Frequent updates require a more active maintenance approach.
Advanced routing and proxy configurations require careful planning.
Open-source edition lacks some NGINX Plus features.
Dynamic module compatibility requires attention.
Windows support is more limited than Unix-based deployments.
Advanced application security features may require external modules or additional services.
How to Install
There are several ways to install NGINX Mainline. The official NGINX package repository is convenient for production environments because it provides maintained packages and updates independently of the distribution's default repositories.
For custom installations, compiling the mainline source code provides more control over modules, dependencies, installation paths, and compiler options.
Install from the Official Repository
On Debian or Ubuntu, configure the official NGINX repository and select the mainline package source.
Install the required repository tools:
sudo apt update
sudo apt install curl gnupg2 ca-certificates lsb-release debian-archive-keyringImport the official signing key:
curl -fsSL https://nginx.org/keys/nginx_signing.key \
| gpg --dearmor \
| sudo tee /usr/share/keyrings/nginx-archive-keyring.gpg >/dev/nullConfigure the mainline repository:
echo "deb [signed-by=/usr/share/keyrings/nginx-archive-keyring.gpg] \
https://nginx.org/packages/mainline/ubuntu $(. /etc/os-release && echo "$VERSION_CODENAME") nginx" \
| sudo tee /etc/apt/sources.list.d/nginx.listFor Debian, replace ubuntu in the repository URL with debian.
Install NGINX:
sudo apt update
sudo apt install nginxThe official repository provides both Stable and Mainline packages. Make sure the repository points to packages/mainline if you want to receive mainline updates.
Compile NGINX Mainline from Source
The GitHub repository contains the actively developed mainline source code. Clone the repository:
git clone https://github.com/nginx/nginx.git
cd nginxInstall the required build dependencies on Debian or Ubuntu:
sudo apt update
sudo apt install build-essential libpcre2-dev zlib1g-dev libssl-devConfigure the build:
auto/configure \
--prefix=/usr/local/nginx \
--with-http_ssl_module \
--with-http_v2_module \
--with-http_v3_module \
--with-http_realip_module \
--with-http_gzip_static_module \
--with-http_stub_status_module \
--with-stream \
--with-stream_ssl_moduleCompile and install:
make -j"$(nproc)"
sudo make installThe HTTP/3 option requires a compatible QUIC-capable TLS library and additional build configuration. If those dependencies are unavailable, remove --with-http_v3_module.
Check the installed build:
/usr/local/nginx/sbin/nginx -VTest the configuration and start NGINX:
sudo /usr/local/nginx/sbin/nginx -t
sudo /usr/local/nginx/sbin/nginxFor production deployments, configure NGINX as a systemd service and manage its lifecycle through systemd.
When building from the GitHub repository, remember that cloning the mainline branch retrieves the latest development source. For reproducible production builds, check out a specific release tag or commit instead of relying on a moving branch.
Final Verdict
NGINX Mainline is an excellent choice for developers and administrators who want the latest improvements in one of the most capable open-source web servers available. Its combination of reverse proxying, load balancing, caching, TLS termination, and TCP/UDP traffic management makes it suitable for a wide range of infrastructure deployments.
Its main advantage over Stable is access to newer features and improvements without waiting for them to be backported or included in a later stable release. This is particularly useful for environments that need modern protocol support and benefit from ongoing development.
However, the faster release cycle requires more attention to upgrades, testing, and compatibility. Organizations with strict change-control policies may prefer Stable, while administrators comfortable with regular maintenance can benefit from Mainline.
Overall, NGINX Mainline is a strong option for modern web servers, application gateways, reverse proxies, and high-traffic infrastructure.




