1.Point domain to server

In Godaddy, point the domain name wizclub.io to the VPS server IP 108.61.218.190

2.Install Nginx

Install Nginx either with apt-get or compile from source code. Simply, we use apt-get here.

sudo apt-get update
sudo apt-get install nginx

3.Install Let's Encrypt client

Install Let's Encrypt tool from GitHub

sudo apt-get install git
sudo git clone https://github.com/letsencrypt/letsencrypt /opt/letsencrypt

4.Obtain a certification

Generate the Certification files by executing letsencrypt-auto CLI, follow and answer the the questions if any.

sudo systemctl stop nginx
./letsencrypt-auto certonly --standalone
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Plugins selected: Authenticator standalone, Installer None
Enter email address (used for urgent renewal and security notices) (Enter 'c' to
cancel): zhub.io@qq.com

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Please read the Terms of Service at
https://letsencrypt.org/documents/LE-SA-v1.2-November-15-2017.pdf. You must
agree in order to register with the ACME server at
https://acme-v02.api.letsencrypt.org/directory
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
(A)gree/(C)ancel: A

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Would you be willing to share your email address with the Electronic Frontier
Foundation, a founding partner of the Lets Encrypt project and the non-profit
organization that develops Certbot? We would like to send you email about our work
encrypting the web, EFF news, campaigns, and ways to support digital freedom.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
(Y)es/(N)o: N
Please enter in your domain name(s) (comma and/or space separated)  (Enter 'c'
to cancel): wizclub.io
Obtaining a new certificate
Performing the following challenges:
http-01 challenge for wizclub.io
Waiting for verification...
Cleaning up challenges

IMPORTANT NOTES:
 - Congratulations! Your certificate and chain have been saved at:
   /etc/letsencrypt/live/wizclub.io/fullchain.pem
   Your key file has been saved at:
   /etc/letsencrypt/live/wizclub.io/privkey.pem
   Your cert will expire on 2019-08-22. To obtain a new or tweaked
   version of this certificate in the future, simply run
   letsencrypt-auto again. To non-interactively renew *all* of your
   certificates, run "letsencrypt-auto renew"
 - Your account credentials have been saved in your Certbot
   configuration directory at /etc/letsencrypt. You should make a
   secure backup of this folder now. This configuration directory will
   also contain certificates and private keys obtained by Certbot so
   making regular backups of this folder is ideal.
 - If you like Certbot, please consider supporting our work by:

   Donating to ISRG / Lets Encrypt:   https://letsencrypt.org/donate
   Donating to EFF:                    https://eff.org/donate-le

martin@datarank:/opt/letsencrypt$

5.Configure Nginx to use cert

Let's config the generated cert files into Nginx configration.

sudo vi /etc/nginx/sites-available/default
server {
        listen 80;
        server_name wizclub.io;
        return 301 https://$host$request_uri;
}

server {
#        listen 80;
#        listen [::]:80;
        listen 443 ssl;
        server_name wizclub.io;

        ssl_certificate /etc/letsencrypt/live/wizclub.io/fullchain.pem;
        ssl_certificate_key /etc/letsencrypt/live/wizclub.io/privkey.pem;

        ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
        ssl_prefer_server_ciphers on;
        ssl_ciphers 'EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH';

        root /home/martin/wizclub;
        index index.html;

        location / {
                try_files $uri $uri/ =404;
        }
}

sudo systemctl restart nginx

6.Setup certificate auto-renewal

TO BE CONTINUED...