Amazon Linux NGINX 1.9 or lower
Last updated 2023-03-29
Our distribution release depends on the EPEL repository. You will need to ensure your system also has it installed.
For Red Hat CentOS 6, we currently only support Amazon Linux 2018.03 or earlier.
Add the package repositories
Add the version of the Red Hat CentOS package repository that you want to use.
Red Hat CentOS 7
1$ sudo tee /etc/yum.repos.d/sigsci.repo <<-'EOF'2[sigsci_release]3name=sigsci_release4baseurl=https://yum.signalsciences.net/release/el/7/$basearch5repo_gpgcheck=16gpgcheck=17enabled=18gpgkey=https://yum.signalsciences.net/release/gpgkey https://dl.signalsciences.net/sigsci-agent/gpg.key9sslverify=110sslcacert=/etc/pki/tls/certs/ca-bundle.crt11EOF
Red Hat CentOS 6
NOTE
After Q2 2017, RHEL6 and CentOS 6 will exit Production Phase 2 according to the Red Hat Enterprise Linux Life Cycle. Only limited critical security fixes will be issued. You will need to review the lifecycle document for details and plan appropriately.
1$ sudo tee /etc/yum.repos.d/sigsci.repo <<-'EOF'2[sigsci_release]3name=sigsci_release4baseurl=https://yum.signalsciences.net/release/el/6/$basearch5repo_gpgcheck=16gpgcheck=17enabled=18gpgkey=https://yum.signalsciences.net/release/gpgkey https://dl.signalsciences.net/sigsci-agent/gpg.key9sslverify=110sslcacert=/etc/pki/tls/certs/ca-bundle.crt11EOF
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 on 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. For Red Hat based Linux distributions we've based them off the EPEL packages as neither Red Hat or CentOS ship an NGINX package in their default distribution.
- 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 |
---|---|---|---|
Amazon Linux 2015.09.01 | unsupported | 1.8.1 | 1.9.10 |
The versions are dependent on the upstream package maintainer's supported version.
Yum repository setup for Amazon Linux 2015.09.01
Create a file
/etc/yum.repos.d/sigsci_nginx.repo
with the following contents:Distribution (Amazon Linux 2015.09.01) flavor
NOTE
Our distribution release depends on the EPEL repository, you will need to ensure your system also has it installed.
1[sigsci_nginx]2name=sigsci_nginx3priority=14baseurl=https://yum.signalsciences.net/nginx/distro/el6/$basearch5repo_gpgcheck=16gpgcheck=07enabled=18gpgkey=https://yum.signalsciences.net/nginx/gpg.key9sslverify=110sslcacert=/etc/pki/tls/certs/ca-bundle.crt1112[sigsci-nginx-noarch]13name=sigsci_nginx_noarch14priority=115baseurl=https://yum.signalsciences.net/nginx/distro/el6/noarch16repo_gpgcheck=117gpgcheck=018enabled=119gpgkey=https://yum.signalsciences.net/nginx/gpg.key20sslverify=121sslcacert=/etc/pki/tls/certs/ca-bundle.crtStable (Amazon Linux 2015.09.01) flavor
1[sigsci_nginx]2name=sigsci_nginx3priority=14baseurl=https://yum.signalsciences.net/nginx/stable/el6/$basearch5repo_gpgcheck=16gpgcheck=07enabled=18gpgkey=https://yum.signalsciences.net/nginx/gpg.key9sslverify=110sslcacert=/etc/pki/tls/certs/ca-bundle.crtMainline (Amazon Linux 2015.09.01) flavor
1[sigsci_nginx]2name=sigsci_nginx3priority=14baseurl=https://yum.signalsciences.net/nginx/mainline/el6/$basearch5repo_gpgcheck=16gpgcheck=07enabled=18gpgkey=https://yum.signalsciences.net/nginx/gpg.key9sslverify=110sslcacert=/etc/pki/tls/certs/ca-bundle.crt
Rebuild the
yum
cache for the Signal Sciences repository.$ yum -q makecache -y --disablerepo=* --enablerepo=sigsci_*Install the version of NGINX provided by Signal Sciences.
$ yum 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 with
yum
.$ sudo yum 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.
Amazon Linux 2
$ systemctl restart nginxAmazon Linux 2015.09.01
$ 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.