Skip to content

Instantly share code, notes, and snippets.

@4ft35t

4ft35t/google.conf

Created Mar 6, 2015
Embed
What would you like to do?
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