/compat/nginx/nginx-stable-vs-mainline
nginx stable vs mainline: version numbers and which branch to run
The commands on this page have not been executed by our verification runner yet.updated 2026-10-20
- tool
- nginx
- versions
- nginx 1.x
- os
- any
nginx has two release branches. Mainline has an odd minor version (1.29, 1.31) and gets new features and every bug fix. Stable has an even minor version (1.28, 1.30) and gets only critical fixes, including security fixes. About once a year the current mainline is branched into a new stable version, and the previous stable branch stops receiving updates.
Reading a version number
| Version | Branch | Meaning |
|---|---|---|
| 1.31.x | mainline | odd minor: features land here first |
| 1.30.x | stable | even minor: frozen features, critical fixes only |
| 1.28.x | legacy | previous stable, no longer updated by nginx.org once 1.30 is out |
nginx -v prints the version; distribution packages may be older but carry backported security patches, so compare against the distribution's advisories rather than nginx.org.
Which one to run
- The nginx developers recommend mainline for most users: fixes reach it first, and it is not less reliable than stable.
- Stable suits environments where any behaviour change needs review, or where third-party modules are only tested against stable.
- Official packages for both branches are on nginx.org for Debian, Ubuntu, RHEL and others; distribution repositories usually ship a stable version.
Sources
Related pages
changes · nginxnginx 1.24 to 1.30: the http2 directive, HTTP/3 and other changesUpgrading nginx from 1.24 to 1.30: listen ... http2 is deprecated in favour of http2 on, HTTP/3 over QUIC arrived in 1.25, and upstreams can re-resolve DNS.cheat sheets · nginxnginx cheat sheet: commands, server blocks, locations and proxyingnginx cheat sheet: test and reload, logs, server blocks, location matching order, reverse proxy headers, HTTPS redirects, static files and caching headers.commands · nginxnginx -t: test the configuration before reloadingnginx -t checks the configuration syntax and the files it references without touching the running server; nginx -T also prints the full merged config.