-
-
Save anonymous/5abe2cbaaf540d8e1b96 to your computer and use it in GitHub Desktop.
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 /var/nginx/cache/one levels=1:2 keys_zone=one:10m max_size=2g; | |
proxy_cache_key "$host$request_uri"; | |
upstream google { | |
server 74.125.31.105:80 max_fails=3; | |
server 74.125.31.104:80 max_fails=3; | |
server 74.125.31.106:80 max_fails=3; | |
server 74.125.31.103:80 max_fails=3; | |
server 74.125.31.147:80 max_fails=3; | |
} | |
server { | |
listen 80; | |
server_name xx.xxx;#这里把xx.xxx换成你自己的域名 | |
rewrite ^(.*) https://xx.xxx$1 permanent;#这里把xx.xxx换成你自己的域名 | |
} | |
server { | |
listen 443; | |
server_name xx.xxx; | |
ssl on; | |
ssl_certificate /usr/local/nginx/conf/ssl/ssl.crt;#这里换成你自己的SSL证书路径和证书名字 | |
ssl_certificate_key /usr/local/nginx/conf/ssl/ssl.key;#这里换成你自己的私钥文件路径和名称 | |
location / { | |
proxy_cache one; | |
proxy_cache_valid 200 302 1h; | |
proxy_cache_valid 404 1m; | |
proxy_redirect http://www.google.com/ /; | |
proxy_cookie_domain google.com xx.xxx;#这里把xx.xxx换成你自己的域名 | |
proxy_pass http://173.194.127.48; | |
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"; | |
sub_filter www.google.com xx.xxx;#这里把xx.xxx换成你自己的域名 | |
sub_filter_once off; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment