Nginx反向代理Google扩展ngx_http_google_filter_module
模块介绍
ngx_http_google_filter_module是一个过滤器模块,能够让谷歌镜像更便捷的部署。内建了正则表达式、URI locations和其他复杂的配置。原生nginx模块确保了更加高效地处理cookies, gstatic scoures和重定向。
安装Nginx
使用《OneinStack》Nginx选择y,其余n
重新编译Nginx,安装ngx_http_google_filter_module模块
- cd /root/oneinstack/src
- git clone https://github.com/cuber/ngx_http_google_filter_module
- git clone https://github.com/yaoweibin/ngx_http_substitutions_filter_module
- wget http://mirrors.linuxeye.com/oneinstack/src/pcre-8.39.tar.gz
- wget http://mirrors.linuxeye.com/oneinstack/src/openssl-1.0.2j.tar.gz
- tar xzf pcre-8.39.tar.gz
- tar xzf openssl-1.0.2j.tar.gz
- tar xzf nginx-1.10.2.tar.gz
- cd nginx-1.10.2
- ./configure --prefix=/usr/local/nginx --user=www --group=www --with-http_stub_status_module
- --with-http_v2_module --with-http_ssl_module --with-ipv6 --with-http_gzip_static_module
- --with-http_realip_module --with-http_flv_module --with-openssl=../openssl-1.0.2j
- --with-pcre=../pcre-8.39 --with-pcre-jit --with-ld-opt="-ljemalloc"
- --add-module=../ngx_http_google_filter_module
- --add-module=../ngx_http_substitutions_filter_module
- make
- mv /usr/local/nginx/sbin/nginx{,_`date +%m%d`} #备份现有nginx
- cp objs/nginx /usr/local/nginx/sbin/ #更新nginx
- nginx -t #检查nginx语法
- service nginx restart
声明:该文观点仅代表作者本人,牛骨文系教育信息发布平台,牛骨文仅提供信息存储空间服务。
copyright © 2008-2019 亿联网络 版权所有 备案号:粤ICP备14031511号-2