Where does nginx expect to find the binary files for its modules? For example, by convention, where should I install module nginx_ajp_module
?
Where does nginx expect to find the binary files for its modules? For example, by convention, where should I install module nginx_ajp_module
?
The module path will vary depending on the Linux distribution you're using. Some distros (e.g. Debian-based) may put it in strange places.
To find the module path on your system, run
nginx -V
and look for the--modules-path
in the output. For example:You should also be aware that dynamic module loading was only introduced in the 1.10 development cycle. Modules older than this were designed to be compiled directly into nginx, and would need to be updated for dynamic loading. The module you linked to is such a one. Contact its developer for further information.
nginx -V
will only reveal the--modules-path
config flag if nginx was configured with an explicit--modules-path
argument. (I.e., if you ran./configure --modules-path=/path/to/modules
when compiling nginx, you'd see--modules-path=/path/to/modules
in the output ofnginx -V
.) The default location, if no path was specified at compile time, is$NGX_PREFIX/modules
. On my macOS system,$NGX_PREFIX
defaults to/usr/local/nginx
, so the default modules path is/usr/local/nginx/modules
; whereas Ubuntu 17.10 breaks the prefixed monolith up a bit and expects modules in/usr/lib/nginx/modules
.As with many *nix-adjacent things, configuration is privileged over convention here. You may find that your best bet is to compile nginx on your own, specifying the
--prefix=
and/oror--modules-path=
flags when running./configure
. There are some good docs on that process here and here.