大神, 我想配个 nginx 作为访问 google 代理,但现在仅支持 google.com
不知道 google 的全部域名、、、 google 图片里面还有大量使用二级域名的, 有没有方案可以使用 nginx 配置 google 的所有服务呢?
不配 vpn 和在客户端安装软件与做任何配置的前提下。 谢谢
现在的配置如下:
upstream google {
server 74.125.239.128:80 max_fails=1;
server 74.125.239.129:80 max_fails=1;
server 74.125.239.130:80 max_fails=1;
server 74.125.239.131:80 max_fails=1;
server 74.125.239.132:80 max_fails=1;
server 74.125.239.133:80 max_fails=1;
server 74.125.239.134:80 max_fails=1;
server 74.125.239.135:80 max_fails=1;
server 74.125.239.136:80 max_fails=1;
server 74.125.239.137:80 max_fails=1;
server 74.125.239.142:80 max_fails=1;
server 216.58.192.14:80 max_fails=1;
}
server {
listen 443 ssl spdy_detect spdy;
server_name www.bool.so;
ssl on;
ssl_certificate /opt/sslkeys/bool.so.crt;
ssl_certificate_key /opt/sslkeys/bool.so.key;
location / {
expires max;
proxy_cache one;
proxy_cache_valid 200 302 1h;
proxy_cache_valid 404 1m;
proxy_redirect https://www.google.com/ /;
proxy_cookie_domain google.com bool.so;
proxy_pass http://google;
proxy_set_header Host "www.google.com";
proxy_set_header Accept-Encoding "";
proxy_set_header User-Agent $http_user_agent;
proxy_set_header Accept-Language "zh-CN";
proxy_set_header Cookie "PREF=ID=047808f19f6de346:U=0f62f33dd8549d11:FF=2:LD=zh-CN:NW=1:TM=1325338577:LM=1332142444:GM=1:SG=2:S=rE0SyJh2w1IQ-Maw";
sub_filter_types text/javascript application/javascript text/css;
sub_filter_once off;
}
}