Debian NGINX 1.10-1.14
Last updated 2023-03-09
Add the package repositories
Add the version of the Debian package repository that you want to use.
Debian 10 - Buster
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/debian/ buster main" | sudo tee /etc/apt/sources.list.d/sigsci-release.list5$ sudo apt-get update
Debian 9 - Stretch
1$ sudo apt-get install -y apt-transport-https wget gnupg2$ wget -qO - https://apt.signalsciences.net/release/gpgkey | sudo apt-key add -3$ sudo tee /etc/apt/sources.list.d/sigsci-release.list <<-'EOF'4deb https://apt.signalsciences.net/release/debian/ stretch main5EOF6$ sudo apt-get update
Debian 8 - Jessie
1$ sudo apt-get install -y apt-transport-https wget2$ wget -qO - https://apt.signalsciences.net/release/gpgkey | sudo apt-key add -3$ sudo tee /etc/apt/sources.list.d/sigsci-release.list <<-'EOF'4deb https://apt.signalsciences.net/release/debian/ jessie main5EOF6$ sudo apt-get update
Debian 7 - Wheezy
1$ sudo apt-get install -y apt-transport-https wget2$ wget -qO - https://apt.signalsciences.net/release/gpgkey | sudo apt-key add -3$ sudo tee /etc/apt/sources.list.d/sigsci-release.list <<-'EOF'4deb https://apt.signalsciences.net/release/debian/ wheezy main5EOF6$ 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 Lua and LuaJIT support. You must first ensure that Lua is installed and enabled for NGINX before enabling the Signal Sciences NGINX module.
Install the Lua NGINX Module
Install the dynamic Lua NGINX Module appropriate for your NGINX distribution.
NGINX.org distribution
Install the Lua NGINX Module.
NGINX 1.12.1 or higher
$ sudo apt-get install nginx-module-luaNGINX 1.11
$ sudo apt-get install nginx111-lua-moduleNGINX 1.10
$ sudo apt-get install nginx110-lua-module
In your NGINX config file (located by default at
/etc/nginx/nginx.conf
), add the following lines to the global section after the line that starts withpid
:load_module modules/ndk_http_module.so;load_module modules/ngx_http_lua_module.so;Restart the NGINX service to initialize the new module.
$ sudo service nginx restart
Debian distribution
Enable Lua by installing the nginx-extras
package.
$ sudo apt-get install nginx-extras && sudo service nginx restart
Check that Lua is loaded correctly
Load the following config (e.g., sigsci_check_lua.conf
) with NGINX to verify that Lua has been loaded properly:
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}
Example of a successfully loaded config and its 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
Debian 8 or higher
$ sudo systemctl unmask nginx && sudo systemctl restart nginxDebian 7
$ sudo service nginx restart
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.