Installing Nginx Server
- Create a directory to store the server key, certificate, and intermediate bundle.
mkdir /etc/nginx/ssl
-
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 the /etc/nginx/ssl folder.
-
Navigate to the SSL folder in SSH.
cd /etc/nginx/ssl
- 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 must be listed in this order with the concatenate command, or the SSL will not work correctly on your server.
- Open your Nginx** config file** for the domain.
vim /etc/nginx/conf.d/ssl-host.conf
- 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;
}
- Restart your Nginx server.
systemctl restart nginx
Updated 10 months ago