Installing SSL: Nginx

The following instructions explain how to install an SSL Certificate on Nginx.


Step 1

Nginx requires a single file containing the SSL certificate.

The. crt and the .ca-bundle file must be merged by cat command.

Example Syntax:

cat yourdomain.crt > ssl-bundle.crt


Step 2

Copy the newly created ssl-bundle.crt into the /etc/ssl/certs/ directory.

The key server.key is copied to the directory/etc/ssl/private/.


Step 3

Open the configuration file with any editor (e.g. Notepad++, Sublime Text2) of your choice. This can usually be found in one of the following directories:




Locate the VirtualHost configuration section that you want to secure using SSL and add the following configuration.


Server {


lists 443;


ssl on;

ssl_certificate /etc/ssl/certs/ssl-bundle.crt;

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


#enables all versions of TLS, but not SSLv2 or 3 which are weak and now deprecated.


ssl_protocols TLSv1 TLSv1.1 TLSv1.2;




Step 4


Check the configuration for errors with the following command:

sudo nginx -t -t -c /etc/nginx/nginx.conf


If everything is fine, restart the server.

sudo /etc/init.d/nginx restart


Was this article helpful?

Thank you very much for your review!

Thank you very much for your review!

You have already rated this item.

Thank you for your time.

Do you require assistance?


Telephone support

Companies that trust us

Other products you might be interested in
Website Builder
Create your own website without any programming knowledge.
Create a Website
Concentrate fully on your project! Performance and security included.
Optimize your Web site and achieve top rankings.
Website optimization
SSL Certificates
For your site, more safety protect yourself from hacker attacks.
Quickly protect