Nginx by examples: naxsi WAF
Naxsi is an open source WAF module developed by NBS System and released under GPL v3
In the past a nginx-naxsi
standard Ubuntu package was available from the official repositories. Unfortunately this package is no longer maintained so we must now rebuild Nginx from source to use Naxsi
System setup
Let’s start with a fresh Ubuntu 14.04.x system
# this is needed to build nginx
sudo apt-get install libpcre3 libpcre3-dev libssl-dev unzip make -y
cd /tmp
# we download Nginx
wget http://nginx.org/download/nginx-1.8.1.tar.gz
# we download the latest Naxsi source code
wget https://github.com/nbs-system/naxsi/archive/master.zip
tar xvzf nginx-1.8.1.tar.gz
unzip master.zip
cd nginx-1.8.1/
Now we need to build Nginx with the Naxsi waf module we just downloaded
# a standard configure block where we disable
# some normally unused nginx modules (POP3 / IMAP / SMTP etc)
./configure
...