Enabling modules
By default, not every module for NGINX has been compiled and is available. As of version 1.9.11 (released in February 2016), NGINX added dynamic modules, similar to the Dynamic Shared Objects (DSO) like the Apache HTTP server.

Previous NGINX build process
Previous to this, you needed to recompile NGINX every time you updated a module, so this is a big step forward. Being statically compiled into the main binary also meant that each instance of NGINX loaded all the modules internally, regardless of whether you needed them or not. This is why the mail modules were never compiled in with the standard binaries.

NGINX new dynamic modules
How to do it...
However, even though 1.9.11 added the dynamic modules, none of the standard modules are dynamic by default. To make them into dynamic modules, you'll need to update the configure options. For example, to make the mail module dynamic, update --with-mail
to --with-mail=dynamic
.
The main nginx.conf
configuration file will then need the following:
load_module "modules/ngx_mail_module.so";
Note
Official Link
: https://www.nginx.com/resources/wiki/extending/
See also
There are a number of third-party modules for NGINX, some of which we'll be using later in this book and can be found at https://www.nginx.com/resources/wiki/modules/.