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;
}
}

Thank you for reading.
This post is copyrighted by Liyuliang’s Blog.
If reproduced, please indicate the source: Liyuliang’s Blog
This blog uses Creative Commons Attribution-NonCommercial-Share-Sharing 4.0 International License Agreement to license.


Comments

Your browser is out-of-date!

Update your browser to view this website correctly. Update my browser now

×