Due to a new environment where the router does not support installing Shadowsocks or V2Ray, accessing Google to search vast technical content in English is not possible. Here, we use the official Google mirror container to build a Google mirror site and map it to our existing domain.
Requirements:
- A VPS such as Vultr, etc.
- A domain name. In this case, we use
google.bobobk.com
as the Google mirror domain.
I chose an Amazon VPS. Since I couldn’t find a good CentOS image, I used Ubuntu as the operating system.
Steps to build the mirror site:
- Set domain DNS to point to your VPS
- Add the site to your nginx server. I used the BT (BaoTa) panel, which is quite convenient.
- Modify the config file to set up a reverse proxy to Docker’s mapped port
1. Set domain resolution
Since I use Cloudflare CDN, I’ll use it as an example.
2. Add the site to the nginx server
Add the site and input the domain name. You can also configure SSL while you’re at it.
3. Modify config file to set reverse proxy to Docker’s mapped port
As shown, nginx is mapped to local port 8000
, so the Docker container will also need to run on port 8000
.
Now onto Docker installation and deployment.
1. Install Docker
yum install docker -y
2. Deploy the Google mirror
Here’s the code:
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
apt-get update
docker run -p 8000:80 -d bohan/onemirror
Just visit google.bobobk.com
and you’ll see the Google mirror is up and running.
For security reasons and to prevent abuse, I later removed the domain resolution for the mirror site.