wget http://nginx.org/download/nginx-1.6.3.tar.gz
wget http://nginx.org/download/nginx-1.8.1.tar.gz
wget http://zlib.net/zlib-1.2.8.tar.gz
wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.38.tar.gz
wget http://www.openssl.org/source/openssl-fips-2.0.12.tar.gz
TAR-ZXVF nginx-1.6.3.tar.gz
TAR-ZXVF zlib-1.2.8.tar.gz
TAR-ZXVF pcre-8.38.tar.gz
TAR-ZXVF openssl-fips-2.0.12.tar.gz
CD openssl-fips-2.0.10
./config
Make
sudo make install
CD zlib-1.2.8
./configure
Make
sudo make install
CD pcre-8.38
./configure
Make
sudo make install
CD nginx-1.6.3
./configure--with-pcre=. /pcre-8.38--with-zlib=. /zlib-1.2.8--with-openssl=. /openssl-fips-2.0.12
Make
sudo make install
Cd/usr/local/nginx/sbin
sudo./nginx
----------------------------
Add Naxsi Module
wget Https://github.com/nbs-system/naxsi/archive/master.zip
MV Master.zip Naxsi-master.zip
Unzip Naxsi-master.zip
Execute the./nginx-v command under the installed nginx/sbin/to view the original nginx./configure after copying and adding the Naxsi module
Added:--add-module=. /naxsi-master/naxsi_src
./configure--with-pcre=. /pcre-8.38--with-zlib=. /zlib-1.2.8--with-openssl=. /openssl-fips-2.0.10--add-module=. /naxsi-master/naxsi_src
Make
sudo make install
CP ~/naxsi-master/naxsi_config/naxsi_core.rules/usr/local/nginx/conf/
Cd/usr/local/nginx/conf
Vim Mysite.rules
The contents are as follows:
#------------------------
#LearningMode; #Enables Learning Mode
secrulesenabled;
#SecRulesDisabled;
Deniedurl "/requestdenied";
# # Check Rules
Checkrule "$SQL >= 8" BLOCK;
Checkrule "$RFI >= 8" BLOCK;
Checkrule "$TRAVERSAL >= 4" BLOCK;
Checkrule "$EVADE >= 4" BLOCK;
Checkrule "$XSS >= 8" BLOCK;
#---------------------------
Vim nginx.conf
Add the following configuration in the HTTP section
Include/usr/local/nginx/conf/naxsi_core.rules;
The location of the server/{
#在这里面增加:
Include/usr/local/nginx/conf/mysite.rules;
}
#增加:
location/requestdenied {
return 403;
}
Main references:
http://blog.cnwyhx.com/centos-nginx-naxsi-install/
The above describes the Juan Antonio Samaranch CentOS Nginx 163 installation process with WAF, including the Juan Antonio Samaranch aspects of the content, I hope to be interested in PHP tutorial friends helpful.