Build Google Mirror By Nginx

Server Environment

1
2
3
4
$ cat /etc/issue
Ubuntu 14.04.4 LTS
$ nginx -v
nginx version: nginx/1.4.6 (Ubuntu)

A simple demo to build a google mirror.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
$ cat /etc/nginx/sites-enabled/google.conf

server {
listen 80;
server_name _;

location / {
proxy_pass https://www.google.com.hk;
proxy_connect_timeout 120;
proxy_read_timeout 600;
proxy_send_timeout 600;

send_timeout 600;
proxy_redirect off;
proxy_set_header X-Real-IP $remote_addr;
# proxy_set_header Host $host;

proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
Share