Skip to content

Instantly share code, notes, and snippets.

@4ft35t
Created March 6, 2015 08:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save 4ft35t/cf148109b9e30dfafbe8 to your computer and use it in GitHub Desktop.
Save 4ft35t/cf148109b9e30dfafbe8 to your computer and use it in GitHub Desktop.
google proxy config for nginx
server
{
deny all;
}
server
{
listen 80;
server_name gg.0xffff.tk;
allow 108.162.0.0/16;
if ($http_cf_visitor !~ https) {
rewrite ^(.*) https://$server_name permanent;
return 403;
}
proxy_redirect https://www.google.com/ /;
proxy_cookie_domain google.com gg.0xffff.tk;
proxy_set_header Accept-Encoding "";
proxy_set_header User-Agent $http_user_agent;
proxy_set_header Accept-Language "zh-CN";
proxy_http_version 1.1;
sub_filter_once off;
subs_filter_types text/css text/xml text/javascript;
location / {
proxy_pass https://www.google.com;
sub_filter www.google.com gg.0xffff.tk;
}
location /search {
proxy_pass https://www.google.com;
sub_filter http://webcache.googleusercontent.com https://wc.0xffff.tk;
}
location /gwt {
proxy_pass http://www.google.com;
}
}
server
{
listen 80;
server_name wc.0xffff.tk;
proxy_http_version 1.1;
proxy_redirect off;
location / {
proxy_pass https://webcache.googleusercontent.com;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment