Add SSL Certification to Nginx Server

Add SSL Certification to Nginx Server

INTRODUCTION

Installing an SSL Certificate on NGINX is the basic process for all web servers wold wide, encrypts the data transmitted over the internet without be an interception by a third party.

Step 1: Combine All Certificates into a Single File

Concatenate the 2 files provided by the Certificate Authority (CA), you should receive the SSL certificate in a .zip file

a) If all three certificates are listed separately, use the command:
cat infinitynetwork_ro.crt infinitynetwork_ro.ca-bundle root.crt > /etc/ssl/certs/fullchain_infinitynetwork_ro.crt
the private key can be placed in /etc/ssl/private/infinitynetwork_ro.key

b) If the intermediate certificates are in one bundle, run:
cat infinitynetwork_ro.crt infinitynetwork_ro.ca-bundle > /etc/ssl/certs/fullchain_infinitynetwork_ro.crt
the private key can be placed in /etc/ssl/private/infinitynetwork_ro.key

Step 2: Add the paths to certificates locations

In the /etc/nginx/sites-available/default

server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
ssl_certificate /etc/ssl/certs/nfullchain_infinitynetwork_ro.crt;
ssl_certificate_key /etc/ssl/private/infinitynetwork_ro.key;
....
}

Save, exit, and restart the server:

sudo systemctl restart nginx

Loading