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.
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:
Locate the VirtualHost configuration section that you want to secure using SSL and add the following configuration.
#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