nginx
on Ubuntu is a virtual package provided by one of five packages from the official repositories (at least as of 14.04, defaulting to nginx-core
, I believe):
$ apt-cache depends nginx | tail -n+2 | cut -d: -f 2 | sort -u
nginx-core
nginx-extras
nginx-full
nginx-light
nginx-naxsi
What is the difference between these packages and what are the recommended use cases for them?
This somewhat old Debian Wiki page has a feature comparison between extras
, full
, light
and naxsi
, but no mention is made of core
. How much of it has changed in 14.04?
secondary
As I understand it, nginx
doesn't support runtime enabling of modules like Apache does, so would installing nginx-extras
impact performance?
While Steven's answer touches on the key points and a very basic summary of what each flavor is, I'll give you a much larger description of the differences, as I work on the packaging quite a bit, and the very different sets of modules in each is absolutely critical to a good answer. The basic descriptions don't do much justice to the comparison. (Also, kudos to Steven quoting my older blog (and even referring to me as a 'maintainer'. I meant to port the nginx-is-coming-to-main post to my newer blog, but I haven't had the opportunity.)
Also note that the latest packages for the NGINX web server are available in the NGINX PPAs, maintained by myself, based almost entirely off of Debian. (Stable PPA (1.6.2 as of this post); Mainline PPA (1.7.7 as of this post, with 1.7.8 slated to land on December 4, 2014))
The Different Flavors of
nginx
:The different flavors are all the same version of
nginx
, however the flavors were decided upon by the Debian package maintainers in order to provide different feature sets (fornginx-extras
) as well as the bare minimum and the most feature-effective 'full' set of functions that web servers tend to have used in websites. The exact reason a feature was chosen over another is not known to me, however in supplementary discussion with one of the Debian maintainers on IRC, a statement was made affirming my initial assessment, that each variant was intended on being a different set of features for a different use case -light
for a lightweight set of features that meets bare minimum of site hosting,full
for a more full set of features without including any much-heavier extras, andextras
for pretty much everything that is in the package that can be included in Ubuntu.naxsi
, prior to 15.04, was the Naxsi variant specifically with only the bare minimum of modules in it, as naxsi could be fairly resource intensive.Supposedly, according to one of the Debian maintainers of NGINX who is regularly coordinating with Upstream NGINX in a private conversation of which I cannot currently post logs, NGINX 2.x is going to have loadable module support. In which case,
light
,full
, andextras
will become metapackages which call upon the individual packages containing each module. The date this becomes the case is not known, however, nor is which modules will actually be capable of doing this.As it currently stands, the
nginx
virtual package is designed to just install one of the available versions. By default, asnginx-core
is in main and we would love if individuals used it more,nginx-core
is the first item seen and install-attempted in the virtual package. (However, thenginx
package can rely on any one of the flavors ofnginx
, and is mainly there to make installation a little bit easier for those who don't need any specific flavor preference)A detailed breakdown with the specific modules available in each variant (based off of the Vivid
debian/control
file and the Trustydebian/control
file (as the Naxsi packages have been removed in Vivid)) is available below. Note that this does not reflect the most up to date changes in Ubuntu, and you should refer to those package descriptions to make sure you have updated, accurate information:nginx-core
is the only flavor in the Main section of the Ubuntu Repositories, as of 14.04, and exists only in the Ubuntu repositories (and is not in the PPAs or Debian, and is not going to be included in Debian ever). It is effectively identical to thenginx-full
flavor, but does not contain any third party modules. The reasoning behind usingnginx-full
as the base for this variant was that we wanted to provide a relatively-full-fledged set of core modules in the built binaries, while keeping third party modules out at the same time. As such, it does not contain any of the third-party modules, since the Security Team did a review of the code and found that third party modules have widely varying coding styles which aren't as nicely supported as the nginx-tarball-included modules (this is discussed more in-depth in the Main Inclusion Request/Report bug, which contains the discussion points and further review discussions as to what could be included in Ubuntu Main fornginx
). A full list of the modules enabled here is in the package description, which I've nitpicked here:nginx-light
is the lightest flavor ofnginx
available. It is in the Universe repository and you have to have that enabled to use it. It does not enable a large amount of the modules available in-core
or-full
. It also contains third-party modules. The modules available in it are as follows:nginx-full
is one of the more feature-rich flavors of thenginx
package. Like itslight
counterpart, it is in the Universe repository. It enables most of the core included modules that are standard and optional in the from-nginx source tarball, as well as several more third-party modules designed to extend the capabilities of the nginx web server. It's modules are as follows:nginx-extras
is the most feature-rich flavor of thenginx
package. And like itsfull
andlight
brothers, it too is in the Universe repository. It enables all of the modules innginx-full
but also includes additional modules (such as the Perl module), and many more third-party modules designed to even further extend the capabilities of the nginx web server. Its full modules list is below:nginx-naxsi
is the variant of nginx which has the Naxsi Web Application Firewall module available. It too is in Universe, however this flavor is no longer supported by Debian maintainers, and will be completely dropped from Ubuntu with the 15.04 release. In addition to the Naxsi WAF module, it also includes a much lighter set of modules thannginx-full
. The full list of modules is below:Resource Usage Among the Flavors
While I am not aware of any benchmarks that have been run on the various flavors of
nginx
, it is typically logical to assume that the more feature-enabled the version ofnginx
you use, the more resources it would use.However, unlike Apache which can be something of a memory whore with the more modules enabled,
nginx
still does not eat as much memory compared to Apache when modules are enabled. (The exception to this statement is thenaxsi
flavor. That flavor always eats a lot more resources, as it is a Web Application Firewall as well as a web server.)I will add benchmarks to this answer if I find them, but again, I am not aware of any existing benchmarks for the various flavors against each other. And even though the sites I run don't have heavy traffic, I haven't noticed any real performance decrease between
nginx-extras
,nginx-full
, ornginx-light
on a PHP-driven site.Here's a very high-level assessment, based mainly on the descriptions in the packages. (I'm going to fall short of delivering example use cases for each, but I figured this much out to satisfy my curiosity so I may as well contribute it.)
From smallest to largest:
nginx-light: "basic version"
The minimal set of modules for basic functionality.
nginx-naxsi: "version with naxsi"
The minimal set, plus the hardened "Nginx Anti Xss & Sql Injection" configuration and its required plugins.
nginx-core: "core version"
The standard nginx deployment, less the third-party modules.
This is the first Canonical-supported nginx package. It's in the Ubuntu "main" repository instead of the community-supported "universe" repository. See the announcement "nginx-core is now in Ubuntu Trusty 14.04 Main!" on an archive of the maintainer's unofficial (older and now defunct) blog or on the copy of the old post on the maintainer's unofficial blog:
nginx-full: "standard version"
The standard nginx deployment, including frequently-used third-party modules.
nginx-extras: "extended version"
The standard nginx deployment plus several infrequently-used and largish modules.
I made some tables based on the descriptions from https://salsa.debian.org/nginx-team/nginx/-/blob/master/debian/control (which, as of writing, was last updated on June 30, 2020). Given that the tables and the descriptions they're based on are hand-generated, there might be mistakes.