Skip to main content

NGINX: Deploy SSL Certificate

Here's quick instructions for deploying an SSL key/cert pair to an NGINX instance.

NOTE: These steps are assumed to be executed as root.

Run as Root

Elevate to root with this:

sudo -i

Create SSL Folder

By default, a fresh NGINX install doesn't yet contain a folder for certificates.

Create the ssl folder, with this:

sudo mkdir /etc/nginx/ssl

Set Permissions

We need to constrain access to the private SSL keys, with the following:

NOTE: NGINX runs as root, so this is fine.

sudo chmod 0600 -R /etc/nginx/ssl
sudo chown root:root -R /etc/nginx/ssl