Nginx中Google 扩展代理模块配置教程
来源:网络 作者:佚名 点击:
次时间:2017-06-13 21:35
[摘要] Google 扩展代理模块对于国内的站长是一个福气了那么我们要如何配置Google 扩展代理模块呢,今天小来为各位介绍一下这个Google 扩展代理模块方法吧。
据说wen.lu开源了,代码大家可以到github自行下载。
[root@hz /]# cd /byrd/tools/
[root@hz tools]# yum install pcre* openssl openssl-devel gcc gcc-c++ wget vim -y
[root@hz tools]# git clone https://github.com/cuber/ngx_http_google_filter_module
[root@hz tools]# git clone https://github.com/yaoweibin/ngx_http_substitutions_filter_module
[root@hz tools]# wget http://nginx.org/download/nginx-1.7.8.tar.gz
[root@hz tools]# cd /byrd/service/
[root@hz service]# wget http://www.openssl.org/source/openssl-1.0.2e.tar.gz
[root@hz service]# cd openssl-1.0.2e/
[root@hz openssl-1.0.2e]# ./config
[root@hz openssl-1.0.2e]# make
[root@hz openssl-1.0.2e]# cd ../../tools/
[root@hz tools]# tar zxf nginx-1.7.8.tar.gz
[root@hz tools]# cd nginx-1.7.8
[root@hz nginx-1.7.8]# ./configure --user=www --group=www --prefix=/byrd/service/nginx-1.7.8 --with-openssl=/byrd/service/openssl-1.0.1h --with-pcre --with-http_ssl_module --with-http_spdy_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_stub_status_module --with-ipv6 --with-http_sub_module --add-module=/byrd/tools/ngx_http_google_filter_module --add-module=/byrd/tools/ngx_http_substitutions_filter_module
[root@hz nginx-1.7.8]# make && make install
[root@hz nginx-1.7.8]# ln -s /byrd/service/nginx-1.7.8 /usr/local/nginx
[root@hz nginx-1.7.8]# cd /usr/local/nginx/conf/
[root@hz conf]# cp nginx.conf nginx.conf.bk
[root@hk conf]# cat ./nginx.conf
worker_processes 1;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
server {
server_name www.111cn.net;
listen 80;
resolver 8.8.8.8;
location / {
google on;
google_scholar on;
google_language "en";
}
}
}
|
------分隔线----------------------------