谁也挡不住你访问Google

展示最终成果:

浏览器打开​

http://www.manda13.com/(慢搭搜索)这个是自己搭建的百度网盘搜索,欢迎测试

 

点击右上角“原版Google”,就可以访问Google.

 

是不是很方便。细心的朋友肯定已经发现链接地址实际上为:​​​http://www.manda13.com:8080/

展示最终成果:

浏览器打开​

http://www.manda13.com/(慢搭搜索)这个是自己搭建的百度网盘搜索,欢迎测试

​​​点击右上角“原版Google”,就可以访问Google.

是不是很方便。细心的朋友肯定已经发现链接地址实际上为:​​​http://www.manda13.com:8080/

最终效果图

下面教程属技术范畴:

用自己的VPS搭建Google反向代理​

一、准备工作

首先要感谢wen.lu的开源。参见GitHub地址:

https://github.com/cuber/ngx_http_google_filter_module

 

有GitHub的可以fork一份到自己的主页。具体内容我就不复制过来了。

感谢Vultr。http://www.Vultr.com/(非广告,一个月5美元,比国内阿里云,西部数码一个月同等水平上百便宜太多)

一台VPS,要在墙外(美国、日本、香港等,)。本人的为Ubuntu14.04系统64位,因为目前网上流传的教程都是基于这个系统。下面开始教程。

最简安装

## 安装 gcc & git#

 

​apt-get install build-essential git gcc g++ make

#​# 下载最新版源码# nginx 

 

 

wget "http://nginx.org/download/nginx-1.7.8.tar.gz"


​## 下载最新版 pcre# pcre 

 

 

wget "ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.38.tar.gz"


​## 下载最新版 openssl# 

 

 

wget "https://www.openssl.org/source/openssl-1.0.1j.tar.gz"


​## 下载最新版 zlib# 

 

 

wget "http://zlib.net/zlib-1.2.8.tar.gz"


​## 下载ngx_http_google_filter_module本扩展#

 

 

​git clone https://github.com/cuber/ngx_http_google_filter_module


​## 下载 substitutions 扩展#

 

 

​git clone https://github.com/yaoweibin/ngx_http_substitutions_filter_module


​## 解压缩#

 

 

​tar xzvf nginx-1.7.8.tar.gz

 tar xzvf pcre-8.38.tar.gz 

tar xzvf openssl-1.0.1j.tar.gz

tar xzvf zlib-1.2.8.tar.gz


​## 进入 nginx 源码目录#

 

 

​cd nginx-1.7.8


​## 设置编译选项#

 

 

​./configure \ 

 ​ --prefix=/opt/nginx-1.7.8 \

 --with-pcre=../pcre-8.38 \

 --with-openssl=../openssl-1.0.1j \ 

 --with-zlib=../zlib-1.2.8 \ 

 --with-http_ssl_module \

 --add-module=../ngx_http_google_filter_module \

 --add-module=../ngx_http_substitutions_filter_module


​## 编译, 安装# 

 

make 

 

sudo make install

​## 启动, 安装过程到此结束#

 

​sudo /opt/nginx-1.7.8/sbin/nginx

 

基本配置方法

http配置方式

server {  

server_name <你的域名>;  

listen 8080;//默认80,本人的80端口被apache2搭建了百度网盘搜索占用  

resolver 8.8.8.8; 

 location / {   

   google on;​​  }
}

https配置方式

server {  

server_name <你的域名>;  

listen 8080;//默认80,本人的80端口被apache2搭建了百度网盘搜索占用  

resolver 8.8.8.8; 

 location / {   

   google on;​​  }
}

## 配置修改后, 需要 reload nginx 来让配置生效, #

 

sudo /opt/nginx-1.7.8/sbin/nginx -s reload

以上本人亲测:进阶教程请找作者中文版教程:​

 

https://github.com/cuber/ngx_http_google_filter_module/blob/master/README.zh-CN.md

 

猜你喜欢

转载自ja-lin.iteye.com/blog/2275011