nginx配置Google海外代理
proxy_cache_path /run/shm levels=1:2 keys_zone=one:100m max_size=1g;
proxy_cache_key $host$request_uri;
upstream google {
server 216.58.221.142 max_fails=3 fail_timeout=10s; //IP自己添加
}
server {
listen 80;
server_name g.ttlsa.com;
location / {
proxy_pass http://google;
proxy_cache one;
proxy_cache_valid 200 302 2h;
proxy_cache_valid 404 1h;
proxy_buffering off;
proxy_cookie_domain google.com g.ttlsa.com;
proxy_redirect https://www.google.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;
sub_filter www.google.com g.ttlsa.com;
sub_filter_once off;
}
}
(原标题:nginx配置Google海外代理)
留言评论