Ubuntu NGINX 1.9 or lower
Last updated 2023-03-29
Add the package repositories
Add the version of the Ubuntu package repository that you want to use.
Ubuntu 22.04 - jammy
1$ sudo apt-get update2$ sudo apt-get install -y apt-transport-https wget gnupg3$ wget -qO - https://apt.signalsciences.net/release/gpgkey | sudo gpg --dearmor -o /usr/share/keyrings/sigsci.gpg4$ sudo echo "deb [signed-by=/usr/share/keyrings/sigsci.gpg] https://apt.signalsciences.net/release/ubuntu/ jammy main" | sudo tee /etc/apt/sources.list.d/sigsci-release.list 5$ sudo apt-get update
Ubuntu 20.04 - focal
1$ sudo apt update2$ sudo apt-get install -y apt-transport-https wget3$ wget -qO - https://apt.signalsciences.net/release/gpgkey | sudo apt-key add -4$ sudo echo "deb https://apt.signalsciences.net/release/ubuntu/ focal main" | sudo tee /etc/apt/sources.list.d/sigsci-release.list && sudo apt-get update
Ubuntu 18.04 - bionic
1$ sudo apt update2$ sudo apt-get install -y apt-transport-https wget3$ wget -qO - https://apt.signalsciences.net/release/gpgkey | sudo apt-key add -4$ sudo echo "deb https://apt.signalsciences.net/release/ubuntu/ bionic main" | sudo tee /etc/apt/sources.list.d/sigsci-release.list && sudo apt-get update
Ubuntu 16.04 - xenial
1$ sudo apt-get install -y apt-transport-https wget2$ wget -qO - https://apt.signalsciences.net/release/gpgkey | sudo apt-key add -3$ sudo echo "deb https://apt.signalsciences.net/release/ubuntu/ xenial main" | sudo tee /etc/apt/sources.list.d/sigsci-release.list && sudo apt-get update
Ubuntu 14.04 - trusty
1$ sudo apt-get install -y apt-transport-https wget2$ wget -qO - https://apt.signalsciences.net/release/gpgkey | sudo apt-key add -3$ sudo echo "deb https://apt.signalsciences.net/release/ubuntu/ trusty main" | sudo tee /etc/apt/sources.list.d/sigsci-release.list && sudo apt-get update
Ubuntu 12.04 - precise
1$ sudo apt-get install -y apt-transport-https wget2$ wget -qO - https://apt.signalsciences.net/release/gpgkey | sudo apt-key add -3$ sudo echo "deb https://apt.signalsciences.net/release/ubuntu/ precise main" | sudo tee /etc/apt/sources.list.d/sigsci-release.list && sudo apt-get update
Enable Lua for NGINX
Some older versions of NGINX don't support native loading of Lua modules. Therefore, we require NGINX to be built with the third party ngx_lua
module. Because most older versions of NGINX do not support dynamically loadable modules, you will likely need to rebuild NGINX from source.
To assist you, we provide pre-built drop-in replacement NGINX packages already built with the ngx_lua
module. This is intended for users who prefer not to build from source, or who either use a distribution-provided package or an official NGINX provided package. These pre-built packages are built to support much older distributions and are not gpg signed.
Flavors
We support three flavors of NGINX. These flavors are based on what upstream package we've based our builds on. All our package flavors are built according to the official upstream maintainer's build configuration with the addition of the ngx_lua
and ngx_devel_kit
modules.
Our provided flavors are:
- Distribution: the distribution flavor is based off the official distribution-provided NGINX packages. For Debian-based Linux distributions (Red Hat and Debian) these are the based off the official Debian NGINX packages.
- Stable: the stable flavor is based off the official NGINX.org stable package releases.
- Mainline: the mainline flavor is based off the official NGINX.org mainline package releases.
Flavor version support
The following versions are contained in the various OS and flavor packages:
OS | Distribution | Stable | Mainline |
---|---|---|---|
Ubuntu 22.04 (Jammy) | 1.18.0 | N/A | N/A |
Ubuntu 20.04 (Focal) | 1.18.0 | N/A | N/A |
Ubuntu 18.04 (Bionic) | 1.14.0 | N/A | N/A |
Ubuntu 16.04 (Xenial) | 1.10.3 | N/A | N/A |
Ubuntu 15.04 (Vivid) | 1.6.2 | 1.8.1 | 1.9.10 |
Ubuntu 14.04 (Trusty) | 1.4.6 | 1.8.1 | 1.9.10 |
Ubuntu 12.04 (Precise) | 1.1.19 | 1.8.1 | 1.9.10 |
The versions are dependent on the upstream package maintainer's supported version.
NOTE
We do not provide a NGINX build for Ubuntu 16.04 and higher since Lua is supported. We only provide our dynamic Lua support modules for those versions.
Apt repository setup for Ubuntu systems
Add the repository key:
$ wget -qO - https://apt.signalsciences.net/nginx/gpg.key | sudo apt-key add -Create a new file
/etc/apt/sources.list.d/sigsci-nginx.list
with the following content based on your OS distribution and preferred flavor:Distribution flavor
OS sigsci-nginx.list
contentUbuntu 15.04 (Vivid) deb https://apt.signalsciences.net/nginx/distro vivid main
Ubuntu 14.04 (Trusty) deb https://apt.signalsciences.net/nginx/distro trusty main
Ubuntu 12.04 (Precise) deb https://apt.signalsciences.net/nginx/distro precise main
Stable flavor
OS sigsci-nginx.list
contentUbuntu 15.04 (Vivid) deb https://apt.signalsciences.net/nginx/stable vivid main
Ubuntu 14.04 (Trusty) deb https://apt.signalsciences.net/nginx/stable trusty main
Ubuntu 12.04 (Precise) deb https://apt.signalsciences.net/nginx/stable precise main
Mainline flavor
OS sigsci-nginx.list
contentUbuntu 15.04 (Vivid) deb https://apt.signalsciences.net/nginx/mainline vivid main
Ubuntu 14.04 (Trusty) deb https://apt.signalsciences.net/nginx/mainline trusty main
Ubuntu 12.04 (Precise) deb https://apt.signalsciences.net/nginx/mainline precise main
Update the
apt
caches.$ apt-get updateUninstall the default NGINX.
$ sudo apt-get remove nginx nginx-common nginx-fullInstall the version of NGINX provided by Signal Sciences.
$ sudo apt-get install nginx
Check Lua is loaded correctly
To verify Lua has been loaded properly load the following config (sigsci_check_lua.conf
) with NGINX:
1# Config just to test for lua jit support2#3# Test from commandline as follows:4# nginx -t -c <explicit path>/sigsci_check_lua.conf5#6
7# The following load_module directives are required if you have installed8# any of: nginx110-lua-module, nginx111-lua-module, or nginx-lua-module9# for your nginx.org installation.10# Also, for some nginx-1.10.nn installed from nginx-extras package, you may11# need to specify the load directives.12# Given the above uncomment the following:13#14# load_module modules/ndk_http_module.so;15# load_module modules/ngx_http_lua_module.so;16
17events {18 worker_connections 768;19 # multi_accept on;20}21http {22init_by_lua '23
24local m = {}25local ngx_lua_version = "dev"26
27if ngx then28 -- if not in testing environment29 ngx_lua_version = tostring(ngx.config.ngx_lua_version)30 ngx.log(ngx.STDERR, "INFO:", " Check for jit: lua version: ", ngx_lua_version)31end32
33local r, jit = pcall(require, "jit")34if not r then35 error("ERROR: No lua jit support: No support for SigSci Lua module")36else37
38 if jit then39 m._SERVER_FLAVOR = ngx_lua_version .. ", lua=" .. jit.version40 if os.getenv("SIGSCI_NGINX_DISABLE_JIT") == "true" then41 nginx.log(ngx.STDERR, "WARNING:", "Disabling lua jit because env var: SIGSCI_NGINX_DISABLE_JIT=", "true")42 end43 ngx.log(ngx.STDERR, "INFO:", " Bravo! You have lua jit support=", m._SERVER_FLAVOR)44 else45 error("ERROR: No luajit support: No support for SigSci")46 end47
48end49
50';51
52}
If the config is successfully loaded, the above script will create the following output:
1$ nginx -t -c <your explicit path>/sigsci_check_lua.conf2
3nginx: [] [lua] init_by_lua:9: INFO: Check for jit: lua version: 100004nginx: [] [lua] init_by_lua:22: INFO: Bravo! You have lua jit support=10000, lua=LuaJIT 2.0.45nginx: the configuration file <your explicit path>/sigsci_check_lua.conf syntax is ok6nginx: configuration file <your explicit path>/sigsci_check_lua.conf test is successful
Install the NGINX module
Install the module.
$ apt-get install sigsci-module-nginxAdd the following to your NGINX configuration file (located by default at
/etc/nginx/nginx.conf
) in thehttp
context:include "/opt/sigsci/nginx/sigsci.conf";Restart the NGINX Service to initialize the new module.
Ubuntu 15.04 or higher
$ sudo systemctl restart nginxUbuntu 14.04 or lower
$ sudo restart nginx
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.