The following instructions explain how to install an SSL Certificate on Nginx.
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 yourdomain.ca-bundle > ssl-bundle.crt
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/.
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:
/etc/nginx/sites-available/
/usr/local/nginx/sites-available/
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;
}
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
Send an email
Telephone support