Last active
November 7, 2015 04:36
-
-
Save ls0f/5dbf3ccadff7134d708d to your computer and use it in GitHub Desktop.
反代google.co.jp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
proxy_cache_path /data/nginx/cache/ levels=1:2 keys_zone=one:10m max_size=10g; | |
proxy_cache_key "$host$request_uri"; | |
upstream google_jp { | |
server 173.194.38.216:80; | |
server 173.194.38.215:80; | |
server 173.194.38.217:80; | |
server 173.194.38.218:80; | |
} | |
server { | |
listen 80; | |
server_name yourdomain.com; | |
location / { | |
proxy_cache one; | |
proxy_cache_valid 200 302 1h; | |
proxy_cache_valid 404 1m; | |
proxy_set_header X-Real-IP $remote_addr; | |
proxy_redirect https://www.google.co.jp/ /; | |
proxy_set_header Host "www.google.co.jp"; | |
proxy_cookie_domain www.google.co.jp yourdomain.com; | |
proxy_pass http://google_jp; | |
proxy_set_header User-Agent $http_user_agent; | |
sub_filter www.google.co.jp yourdomain.com; | |
} | |
} | |
# more info https://www.centos.bz/2014/06/nginx-proxy-google/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment