My nginx server in Hong Kong, directly in the Nginx configuration file to add a bit of content can be
Proxy_cache_path conf/cache/one levels=1:2 keys_zone=one:10m max_ size=10g;proxy_cache_key "$host $request_uri";server { listen 80; server_name g.example.com; access_log /var/log/ nginx/access.log; rewrite ^ (. *) https://g.example.com$1 permanent;} upstream google { server 173.194.127.212; server 173.194.127.208; server 173.194.127.209; server 173.194.127.210; server 173.194.127.211;} server { listen 443; server_name g.example.com; access_log /var/log/nginx/access.log; ssl on; ssl_certificate ssl/g.crt; ssl_ certificate_key ssl/g.key; location / { proxy_cache one ; proxy_cache_ valid 200 302 1h; p roxy_cache_valid 404 1m; proxy_redirect off; proxy_pass https:// www.google.com.hk/; proxy_redirect https://www.google.com.hk/ /; proxy_cookie_domain www.google.com g.example.com; proxy_set_ header x-real-ip $remote _addr; proxy_set_header X-Forwarded-For $proxy _add_x_forwarded_for; 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 "; subs_filter www.google.com g.example.com; }}
Last visit to http://g.example.com can be Oh!!! Come and try it!!!
This article from "Linux" blog, declined reprint!
Using Nginx proxy Google