Use VPS to set up Nginx reverse generation, create a Google mirror, and use SSL encryption

Use VPS to set up Nginx reverse generation, create a Google mirror, and use SSL encryption

Generally speaking, vps has excess performance, so in addition to building a website, you can also create a google mirror for searching.
This article was successfully used under centos 6 64 bit.

Under SSH:
1. Install lnmp
wget http://down.zhujiwiki.com/lnmp.tar.gz
tar xzf lnmp.tar.gz
cd lnmp
./install.sh

It is recommended to install: Nginx, Mysql 5.5, PHP 5.6, Zend Opcache, etc. You can install other components according to your needs. These components can be used to build a website.

2. Create a site After installing lnmp, create a site:
./vhost.sh
Just follow the instructions. (No SSL site is required, which will be explained later)
For example, the jlu.za.net site was created.

3. Create an SSL certificate using a free Let's encrypt certificate.
It is recommended to use a separate folder to store SSL certificates, such as /root/ssl/
For detailed steps, refer to: Quickly obtain/update Let's encrypt certificates

4. Use Nginx to reverse google
Modify the site's configuration file, which is usually in the /usr/local/nginx/conf/vhost directory and starts with the domain name.
Open and replace all with:

 server { listen 443; server_name jlu.za.net; ssl on; ssl_certificate /root/ssl/jlu.crt; ssl_certificate_key /root/ssl/jlu.za.net.key; ssl_protocols SSLv3 TLSv1; ssl_ciphers ALL:-ADH:+HIGH:+MEDIUM:-LOW:-SSLv2:-EXP; location / { proxy_redirect off; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto https; proxy_pass https://www.google.com; } } server { listen 80; server_name jlu.za.net; rewrite ^(.*) https://jlu.za.net$1 permanent; } server { listen 80; server_name www.jlu.za.net; rewrite ^(.*) https://jlu.za.net$1 permanent; }

Replace all jlu.za.net with your domain name.
Replace ssl_certificate and ssl_certificate_key with your domain name certificate and storage directory.

Modify the nginx.conf file, usually in the /usr/local/nginx/conf directory, and add the following to the http area:

 proxy_connect_timeout 5; proxy_read_timeout 60; proxy_send_timeout 5; proxy_buffer_size 16k; proxy_buffers 4 64k; proxy_busy_buffers_size 128k; proxy_temp_file_write_size 128k; proxy_temp_path /data/wwwroot/jlu.za.net/cache/temp; proxy_cache_path /data/wwwroot/jlu.za.net/cache/pathlevels=1:2 keys_zone=cache_one:50m inactive=7d max_size=1g;

Change proxy_temp_path and proxy_cache_path to your cache storage directory.

Finally restart nginx:
service nginx restart
If there is no error, it indicates success.

Demo : https://jlu.za.net/

<<:  BuddhaHost: $5/month/150GB space/75TB traffic/United States/Netherlands

>>:  HostHoarders: $15/year/128MB RAM/5GB storage/250GB bandwidth/KVM/Dallas

Recommend

StableBox: $0.99/year/10GB storage/100GB traffic/1 site

Stablebox is an American hosting company founded ...

prometeus: €5.9/month/1GB RAM/120GB storage/2TB bandwidth/Xen/Dallas

Prometeus, founded in 1997, is a long-established...

Introduction to PowWeb Hosting

Latest offer: $3.88 per month, details at http://...

ServerHosh: $5/month/2GB memory/50GB space/unlimited traffic/1Gbps/KVM/Seattle

ServerHosh, which should be opened by Indians, wa...

Under Linux, smokeping one-click installation script for pagoda/LNMP

Smokeping is the work of Tobi Oetiker, the author...