-
-
Save IlyasDeckers/5350603d52190be288222a305f56607f to your computer and use it in GitHub Desktop.
Nginx Naxsi (firewall) on Ubuntu 16.04
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
apt-get install -y libpcre3 libpcre3-dev libssl-dev unzip make \ | |
libgoogle-perftools-dev google-perftools jq | |
mkdir /tmp/ngxbuild | |
cd /tmp/ngxbuild | |
latestNginx=$(curl -s http://hg.nginx.org/nginx/tags | | |
grep "^ *release-" | head -1 | cut -c 9-) | |
latestNaxsi=$(curl -s https://api.github.com/repos/nbs-system/naxsi/releases | | |
jq -r .[].tag_name | grep -v rc | head -1) | |
wget -q http://nginx.org/download/nginx-${latestNginx}.tar.gz | |
wget -q https://github.com/nbs-system/naxsi/archive/${latestNaxsi}.tar.gz | |
tar xzf nginx-${latestNginx}.tar.gz | |
tar xzf ${latestNaxsi}.tar.gz | |
cd nginx* | |
./configure --conf-path=/etc/nginx/nginx.conf \ | |
--add-module=../naxsi-${latestNaxsi}/naxsi_src/ \ | |
--error-log-path=/var/log/nginx/error.log \ | |
--http-client-body-temp-path=/var/lib/nginx/body \ | |
--http-fastcgi-temp-path=/var/lib/nginx/fastcgi \ | |
--http-log-path=/var/log/nginx/access.log \ | |
--http-proxy-temp-path=/var/lib/nginx/proxy \ | |
--lock-path=/var/lock/nginx.lock \ | |
--pid-path=/var/run/nginx.pid \ | |
--with-http_ssl_module \ | |
--with-http_v2_module \ | |
--with-http_realip_module \ | |
--with-stream \ | |
--with-stream_realip_module \ | |
--with-stream_ssl_module \ | |
--with-google_perftools_module \ | |
--without-mail_pop3_module \ | |
--without-mail_smtp_module \ | |
--without-mail_imap_module \ | |
--without-http_uwsgi_module \ | |
--without-http_scgi_module \ | |
--prefix=/usr | |
make -j 4 | |
make install |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment