Debian 6 重新编译增加substitutions_filter模块

来源:互联网 发布:php优劣是什么 编辑:程序博客网 时间:2024/06/05 20:39
aptitude install gcc g++ vim libncurses5-dev make libxml2-devapt-get -y install subversionapt-get install libpcre3 libpcre3-dev libcurl4-openssl-devwget -c  http://nginx.org/download/nginx-1.0.5.tar.gz tar -zxf nginx-1.0.5.tar.gzwget -c http://wiki.nginx.org/images/5/51/Nginx-accesskey-2.0.3.tar.gztar -zxf Nginx-accesskey-2.0.3.tar.gzsvn checkout http://substitutions4nginx.googlecode.com/svn/trunk/ substitutions4nginx-read-onlycurdir=$(pwd)cd nginx-1.0.5 ./configure --user=nobody --group=nobody  --prefix=/etc/nginx --sbin-path=/usr/sbin/nginx --pid-path=/var/run/nginx.pid  --conf-path=/etc/nginx/nginx.conf   --with-http_stub_status_module --with-http_ssl_module --with-http_gzip_static_module --with-ipv6 --with-pcre --with-http_sub_module --add-module=$curdir/substitutions4nginx-read-only --add-module=$curdir/nginx-accesskey-2.0.3   make make install 


配置文件如下:

server{listen 80;server_name www.qalog.com; #绑定的域名root /var/www/html; #网站目录(搭配lnamp的时候有用处!)access_log off; #off 关闭日志location / {subs_filter 'www.hostloc.com' 'www.qalog.com' gi; #substitutions4nginx替换 (使用方法参照官方)subs_filter '全球主机交流论坛' '全球主机网' gi; #substitutions4nginx替换 (使用方法参照官方)proxy_set_header X-Real-IP $remote_addr;proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;proxy_set_header Referer http://www.hostloc.com; #强制定义Referer,程序验证判断会用到proxy_set_header Host www.hostloc.com; #定义主机头,如果目标站点绑定的域名个server_name项的吻合则使用$hostproxy_pass http://174.127.189.179; #指定目标,建议使用IP或者nginx自定义池proxy_set_header Accept-Encoding ""; #清除编码}}
原创粉丝点击