Installing the NGINX dynamic module
Last updated 2024-06-21
IMPORTANT
This guide only applies to Next-Gen WAF customers with access to the Next-Gen WAF control panel. If you have access to the Next-Gen WAF product in the Fastly control panel, you can only deploy the Next-Gen WAF with the Edge WAF deployment method.
The NGINX dynamic module is compiled and then dynamically loaded into NGINX at runtime without recompiling the entire NGINX binary. This module is written in C and can be integrated with NGINX Open Source and NGINX Plus.
To install the module, complete the following steps:
Adding our package repositories
Before installing the NGINX dynamic module, you must configure your package management system to pull from our repositories.
Alpine Linux 3.11+
$ apk update && apk add wget$ wget -q https://apk.signalsciences.net/sigsci_apk.pub ; mv sigsci_apk.pub /etc/apk/keys$ echo https://apk.signalsciences.net/$(grep -oE '[0-9]+\.[0-9]{2}' /etc/alpine-release)/main | tee -a /etc/apk/repositories && apk update
Amazon Linux
- Amazon Linux 2023 (AL2023)
- Amazon Linux 2 (AL2)
- Amazon Linux 2018.03
$ echo '[sigsci_release]name=sigsci_releasebaseurl=https://yum.signalsciences.net/release/el/$releasever/$basearchgpgcheck=1repo_gpgcheck=1enabled=1gpgkey=https://yum.signalsciences.net/release/gpgkey https://dl.signalsciences.net/sigsci-agent/gpg.keysslverify=1sslcacert=/etc/pki/tls/certs/ca-bundle.crt' | sudo tee /etc/yum.repos.d/sigsci.repo
Debian
- Bullseye (11) and above
- Buster (10) and lower
$ sudo apt-get update$ sudo apt-get install -y apt-transport-https wget gnupg lsb-release$ sudo wget -qO - https://apt.signalsciences.net/release/gpgkey | sudo gpg --dearmor -o /usr/share/keyrings/sigsci.gpg$ sudo echo "deb [signed-by=/usr/share/keyrings/sigsci.gpg] https://apt.signalsciences.net/release/debian/ `lsb_release -cs` main" | sudo tee /etc/apt/sources.list.d/sigsci-release.list$ sudo apt-get update
RHEL and derivatives
The following commands apply to Red Hat Enterprise Linux (RHEL) and its derivatives (e.g., CentOS). Tab names refer to the base RHEL source version.
- RHEL 9
- RHEL 8
- RHEL 7
- RHEL 6
1234567891011
$ sudo tee /etc/yum.repos.d/sigsci.repo <<-'EOF'[sigsci_release]name=sigsci_releasebaseurl=https://yum.signalsciences.net/release/el/9/$basearchrepo_gpgcheck=1gpgcheck=1enabled=1gpgkey=https://yum.signalsciences.net/release/gpgkey https://dl.signalsciences.net/sigsci-agent/gpg.keysslverify=1sslcacert=/etc/pki/tls/certs/ca-bundle.crtEOF
Ubuntu
- Releases 22.04+
- Releases 20.04 and lower
$ sudo apt-get update$ sudo apt-get install -y apt-transport-https wget gnupg lsb-release$ sudo wget -qO - https://apt.signalsciences.net/release/gpgkey | sudo gpg --dearmor -o /usr/share/keyrings/sigsci.gpg$ sudo echo "deb [signed-by=/usr/share/keyrings/sigsci.gpg] https://apt.signalsciences.net/release/ubuntu/ `lsb_release -cs` main" | sudo tee /etc/apt/sources.list.d/sigsci-release.list$ sudo apt-get update
Installing the NGINX dynamic module
After adding our package repositories, you can install the NGINX dynamic module for NGINX Open Source or NGINX Plus.
Limitations and considerations
Keep the following things in mind when installing the NGINX dynamic module:
Before installing the NGINX dynamic module, you must add our package repositories for your distribution and update repository metadata.
The NGINX dynamic module version that you install must mirror the core version of your NGINX installation. For instance, if you have NGINX
1.18.0
installed, you must install version1.18.0
of the module.File names of our NGINX module package versions include the NGINX version that they're compiled against, and in some cases, a build prefix and distribution release (e.g.,
1.25.3-715~jammy
). When build numbers exist for the same NGINX version, we recommend installing the package with the highest build number.Appending a wildcard (
*
) to the installation command ensures you install the latest version available for the specified NGINX version. You may need to update your repository metadata (e.g.,apt update
) for newer versions.
Installing the NGINX dynamic module for NGINX Open Source
Our NGINX dynamic module for NGINX Open Source is compiled for NGINX Open Source. To install this module:
Find your NGINX binary version:
$ nginx -vNOTE
If nothing is returned or you get a
nginx: not found
error, make sure NGINX is correctly installed and available on the applicable shell path. If NGINX has not been installed as a package (e.g., extracted from a tarball), subsequent commands to install packages may fail due to NGINX package dependencies not being met.Use your distributions package manager to install the NGINX dynamic module (
nginx-module-sigsci-nxo
) package for your specific NGINX Open Source release. The version you install must mirror the core version of your NGINX installation.- Debian / Ubuntu
- RHEL / CentOS
- Alpine Linux
- Amazon Linux 2 / 2018.3
To install the lastest version of our module, run the following command:To install a specific version of our module, run the following command, being sure to replace$ sudo apt-get install nginx-module-sigsci-nxo<nginx-core-version>
with the NGINX core version you have installed:For example, if your installed NGINX core version is$ sudo apt-get install nginx-module-sigsci-nxo=<nginx-core-version>\*1.18.0
, the command would be the following:$ sudo apt-get install nginx-module-sigsci-nxo=1.18.0\*
Installing the NGINX dynamic module for NGINX Plus
Our NGINX dynamic module for NGINX Plus is compiled for the NGINX Plus web server maintained by F5. The version of the module you install is based on the core NGINX that NGINX Plus is based on. To install this module:
Find your NGINX core version:
nginx -vFor example, in the response below, NGINX Plus version
R30
correlates to NGINX core version1.25.1
:nginx version: nginx/1.25.1 (nginx-plus-r30-p1)NOTE
If nothing is returned or you get a
nginx: not found
error, make sure NGINX is correctly installed and available on the applicable shell path. If NGINX has not been installed as a package (e.g., extracted from a tarball), subsequent commands to install packages may fail due to NGINX package dependencies not being met.Alternatively, if you know your NGINX Plus version, you can source the correlative NGINX core version it is based on from the NGINX Plus release notes.
Use your distributions package manager to install the NGINX dynamic module (
nginx-module-sigsci-nxp
) package for your specific NGINX Plus release. The version you install must mirror the core version of your NGINX installation.- Ubuntu / Debian
- RHEL / CentOS
- Alpine Linux
- Amazon Linux 2 / AL2 / 2018.3
To install the lastest version of our module that is compatible with your NGINX core version, run the following command:To install a specific version of our module, run the following command, being sure to replace$ sudo apt-get install nginx-module-sigsci-nxp=$(nginx -v 2>&1 | grep -oP 'nginx/\K[0-9.]+')\*<nginx-core-version>
with the NGINX core version you have installed:For example, if your installed NGINX Plus version is$ sudo apt-get install nginx-module-sigsci-nxp=<nginx-core-version>\*R30
, the command would be the following:$ sudo apt-get install nginx-module-sigsci-nxp=1.25.1\*
Loading the NGINX dynamic module
After installing the NGINX dynamic module, you need to declare the NGINX dynamic module in your NGINX configuration so that the module loads into NGINX at runtime:
In your NGINX configuration file (often located by default at
/etc/nginx/nginx.conf
), use the NGINXload_module
directive to load the NGINX dynamic module into NGINX'smain
context (for instance, under thepid
directive).load_module /etc/nginx/modules/ngx_http_sigsci_module.so;Run the following command to make sure your changes are valid:
$ nginx -tThe output will look something like this:
nginx: the configuration file /etc/nginx/nginx.conf syntax is oknginx: configuration file /etc/nginx/nginx.conf test is successfulRestart NGINX:
$ service nginx restartFor servers that are not running an init system (e.g., an Alpine container), the following command will reload the configuration:
$ nginx -s reload(Optional) Verify the module was successfully loaded:
$ cat /var/log/nginx/error.log | grep 'sigsci:'The
error.log
will look something like this when the module is loaded:1970/01/01 00:00:00 [notice] 4242#4242: sigsci_init_main_conf: Using default UDS socket: /var/run/sigsci.sock1970/01/01 00:00:00 [notice] 4242#4242: sigsci:init: setting phase REWRITE: ngx-phase=31970/01/01 00:00:00 [notice] 4242#4242: sigsci:sigsci_create_random: initialized random checking1970/01/01 00:00:00 [notice] 4242#4242: signal process started
Scripting the installation
You can also use a sequence of shell commands to install the NGINX dynamic module. Each command in the sequence sources the output from the previous command as a variable. This can be useful within scripted installations, such as a Dockerfile RUN
directive.
- Debian / Ubuntu
- RHEL / CentOS / Amazon
- Alpine Linux
$ module_version=$(apt-cache madison nginx-module-sigsci-nxo | grep $(nginx -v 2>&1 | grep -oP 'nginx/\K[0-9.]+') | awk -F'|' '{print $2}' | head -n 1 | xargs)$ apt-get install -y nginx-module-sigsci-nxo=$module_version$ unset module_version
Do not use this form to send sensitive information. If you need assistance, contact support. This form is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.