My nginx version is nginx/1.18.0 (Ubuntu).
I want to install a dynamic module on the server https://www.nginx.com/resources/wiki/modules/headers_more/. The official documentation states:
"Grab the nginx source code from nginx.org, for example, the version 1.17.8 (see nginx compatibility), and then build the source with this module:"
wget 'http://nginx.org/download/nginx-1.17.8.tar.gz'
tar -xzvf nginx-1.17.8.tar.gz
cd nginx-1.17.8/
# Here we assume you would install you nginx under /opt/nginx/.
./configure --prefix=/opt/nginx \
--add-module=/path/to/headers-more-nginx-module
make
make install
I have already installed 1.18.0. version and I do not need to wget and unzip a new nginx.
How to install this dynamic module?
Should I just type ./configure? If so, what path/to should I pass in the code?
Looks like you wget nginx v1.17.8. This is not going to work. You should get your current nginx version.
And then you need to get original nginx arguments with this command,
nginx -VCopy the output of that command to a text editor. And do following,
Now copy everything from text file and execute in the nginx source directory (downloaded).
Now stop Nginx and do
makeandmake installStart nginx. Try it.
These instructions were adapted from Install Naxsi Dynamic Module for nginx!
Naxsi is a dynamic module and you can adapt the instructions to install any nginx dynamic module.