In Nginx webserver will the files in NGINX folder be used. Upload the 2 files into /etc/ssl/
- Start by specifying the server should listen to port 443:
listen 443 ssl;
- Make sure the server block includes the line:
ssl on;
- Define the path of the Certificate:
ssl_certificate /etc/ssl/domain.pem;
- Define the path of the Key:
ssl_certificate_key /etc/ssl/domain.key;
- For reference, the SSL part of your configuration file should look similar like below:
listen 443 ssl;
ssl on;
ssl_certificate /etc/ssl/domain.pem;
ssl_certificate_key /etc/ssl/domain.key;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2; ssl_ciphers ECDHE-RSA-AES256-SHA384:AES256-SHA256:RC4:HIGH:!MD5:!aNULL:!eNULL:!NULL:!DH:!EDH:!AESGCM; ssl_prefer_server_ciphers on;
- You can add the following code if you want to force http to https:
if ($scheme != "https") {
rewrite ^ https://$host$uri permanent;
} - Restart NGINX: #
systemctl restart nginx