Installing Nginx Server

  1. Create a directory to store the server key, certificate, and intermediate bundle.
mkdir /etc/nginx/ssl
  1. Copy your SSL certificate and the certificate bundle file to your Nginx server at /etc/nginx/ssl. You should already have a key file on the server when you have generated your certificate request and copy this key to /etc/nginx/ssl folder.

  2. Navigate to the SSL folder in SSH.

cd /etc/nginx/ssl
  1. Combine your SSL certificate and the intermediate bundle into one file using the concatenate command.
cat signed-cert.crt intermediate.crt ca.crt >> bundle.crt

Note: The certificates have to be listed in this order with the concatenate command, or the SSL will not work properly on your server.

  1. Open your Nginx** config file** for the domain.
vim /etc/nginx/conf.d/ssl-host.conf
  1. Update the config file to use the SSL certificate. Save your config file.
server {

listen 443 ssl;



server_name www.cinnox-demo.com;

ssl_certificate /etc/nginx/ssl/ bundle.crt;

ssl_certificate_key /etc/nginx/ssl/private.key;



root /usr/share/nginx/cinnox-demo/;

index index.html index.htm;

}
  1. Restart your Nginx server.
systemctl restart nginx

Did this page help you?