Last active
August 29, 2015 13:56
-
-
Save latpaw/9264141 to your computer and use it in GitHub Desktop.
已经编译安装过的nginx添加过滤关键字的module
This file contains 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
#!/bin/bash | |
set -e | |
git clone https://github.com/yaoweibin/ngx_http_substitutions_filter_module.git ./filter | |
if [[ -s nginx-1.2.7.tar.gz ]]; then | |
echo nginx exists, ready to extract; | |
else | |
echo Nothing found, downloading ... | |
wget -c http://soft.vpser.net/web/nginx/nginx-1.2.7.tar.gz | |
fi | |
tar -zxvf nginx-1.2.7.tar.gz | |
cd nginx-1.2.7 | |
current=`nginx -V 2>&1 | tail -1 | cut -b 22-` | |
./configure $current --add-module=/root/filter | |
make | |
cp /usr/local/nginx/sbin/nginx /usr/local/nginx/sbin/nginx.bak | |
nginx -s stop | |
cp -f ./objs/nginx /usr/local/nginx/sbin/nginx | |
nginx | |
wget http://www.example.com/subs_filter.conf | |
cp subs_filter.conf /usr/local/nginx/conf/subs_filter.conf | |
echo "Just include the conf file into the nginx.conf " |
This file contains 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
subs_filter (keyword|keyword2|(keyw\d\s)) '' ir; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment