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

15% discount code for Godaddy products

Coupon code: gdr1255a Discount: $50 or more, 15% ...

Tospeed: 10 yuan/month/256MB memory/4GB SSD space/2TB traffic/KVM/Novosibirsk

Tospeed, a Chinese hosting provider, has now laun...

VP Easy: $21/year/1GB memory/25GB SSD space/1TB bandwidth/KVM/Las Vegas

VP Easy, owned by Versaweb, has its own AS (AS533...

hosting.de: €4.9/month/1GB RAM/20GB SSD space/5TB bandwidth/KVM/Germany

hosting.de is a German hosting provider that seem...

NFPHosting: $3.5/year/20GB storage/500GB traffic/unlimited accounts/Los Angeles

NFPHosting, which claims to have been founded in ...

$40/year/1024M memory/80G space/3TB traffic VPS —— BudgetVM

The relevant information of BudgetVM has been int...