TrinityTuts

How to add an SSL certificate for a subdomain

SSL (Secure Sockets Laye) is a protocol for establishing an authenticated and encrypted connection between your computer and server. SSL makes the connection secure and also protect the sensitive data which is sent between the server and client.

Secure Web Browsing

SSL is a secure certificate that offers three-layer of protection Authenticity, Data Integrity, Encryption.

  1. Authenticity: server presenting the certificate is in possession of the private key that matches the public key in the certificate.
  2. Data Integrity: It guarantees that your data cannot be modified or corrupted during transfer without being detected.
  3. Encryption: This means that all data send between the browser (client) and website (server) is encrypted.

Look for the following indicators in your browser’s address bar to be sure that a website you are visiting is protected with a trusted SSL certificate

Steps to install the SSL certificate for a subdomain

Step 1. Point your subdomain to your server

Step 2. Now you need to log in to your server as an admin or superuser.

Step 3. For this tutorial, I am using Let’s Encrypt – Free SSL/TLS Certificates.

Step 4. Now you need to run this command sudo certbot --nginx -d subdomain.domain.com to add an SSL certificate to your subdomain replace subdomain.domain.com with your subdomain and hit enter It will ask for some basic information like email on time on installation enter the required information and done your SSL certificate is now installed and your site is ready to serve on HTTPS.

Why you need an SSL certificate?

Adding an SSL certificate to your website gives you three major benefits that you can not ignore.

If you don’t want to do an SSL certificate to your server you can use Cloudflare which does all this for you with minimum configuration.

Hope this post helps you install your SSL certificate on your subdomain.

If you like the above post you can also try Redirect www site traffic to a non-www website in NGINX

Thanks.