It’s easy to migrate to using dynamic modules with NGINX Plus. To install and dynamically load modules, perform the following steps.
They assume that you have configured your package management tool to retrieve files from NGINX rather than the OS vendor’s distribution. The following commands are appropriate for Debian-based systems.
-
Use your operating system’s standard package management tool to remove the nginx‑plus‑extras image and install the base nginx-plus image.
# apt-get update # apt-get remove nginx-plus-extras # apt-get install nginx-plus
-
Install the modules you want to load dynamically (repeat the installation command for each module).
# apt-get install module-name
The dynamically loadable modules are:
- nginx-plus-module-geoip
- nginx-plus-module-headers-more
- nginx-plus-module-image-filter
- nginx-plus-module-lua
- nginx-plus-module-passenger
- nginx-plus-module-perl
- nginx-plus-module-rtmp
- nginx-plus-module-set-misc
- nginx-plus-module-xslt
Note that some modules are not available for certain OS versions because of OS limitations. For details as well as descriptions of the modules, see the NGINX Plus Technical Specifications.
The /etc/nginx/modules directory is created automatically with symbolic links to the installed locations of the .so files for the selected modules.
-
In the main (top-level) context in /etc/nginx/nginx.conf, add a
load_module
directive for each dynamically loadable module you installed.load_module modules/module-name.so;
-
Check the new configuration for syntactic validity and reload NGINX Plus.
# nginx -t && nginx -s reload