How to install ssl certificate for nginx with SSLs.com?
In this post, I would like to introduce a way to quickly setup SSL certificate for any website with https://www.ssls.com/
Step 1: Generate private key and certificate signing request (csr).
To generate private key and certificate signing request, use the following command with a note of these parameters.
- -keyout: private key, for example:
- -out: certificate signing request, for example
Step 2: Via the ssls.com, submit certificate signing request (csr)
Step 3: Add a CNAME record in the Domain Manager like Hostinger & Waiting
Step 4: Get certificate issued and download
After the download process, there gonna be three file
Step 5: Concat bundle
your_domain.crt in order with your favorite text editor
when concating, becareful of the missing new line error. This is an example of missing new line.
-----END CERTIFICATE----------BEGIN CERTIFICATE-----
We can name concated file as
After this time, there are two file that you need to bring to the nginx server.
- Private key file from Step 1, for example:
- Certificate file (
ssl-bundle.crt) which is a concat version of
Step 6: Install private key and certificate file to nginx
nginx.conf file at
/etc/nginx, it’s a need to copy private key file and certificate file to
You can choose different directory, but you need to make it up to date in the
This is an example of nginx config file, the most important attribute are:
After finished editing, restart nginx server with
systemctl restart nginx and enjoy.
- How to install an SSL certificate on a NGINX server?, July 9, 2019, https://www.ssls.com/knowledgebase/how-to-install-an-ssl-certificate-on-a-nginx-server/