You need :
To have already generated the CSR request, you can do it on our website.
To have saved the private key you obtained when you've generated the CSR, it will be needed in this tutorial.
A root access on the server.
To have already installed OpenSSL.
To wait for the certificate authority to validate the CSR. When it is validated, you can download the certificate on your HTTPCS account, in « My SSL Certificates » category and click on « Download ».
NB : All the following commands have to be executed with root privileges.
1. Create a directory named « ssl » in Nginx's directory (if it does not already exist).
2. Extract the archive you just downloaded from your HTTPCS account and copy the files to the directory you had just created.
NB : Replace « deb8user » by your username.
3. Concatenate these 3 files into one named CABundle.cer, using the following command.
NB : Your « CABundle.cer » file should look like this :
4. Go to the « sites-available » folder in the Nginx's directory.
5. Find the VirtualHost configuration file, which is named « your_domain_name » (in this example, you’ll see « example »).
6. Open your VirtualHost configuration file with your favorite text editor.
Be careful, this file is case sensitive !
NB : To make it easier to read, I have removed all comments but it’s not recommended.
NB : This file is a minimal configuration for SSL website, used to illustrate this tutorial. It is really important to properly configure your Nginx server for better performance and security.
7. Make sure the listening port is set to 443.
« server_name » : your domain name
« ssl on » : enables SSL module
« ssl_certificate » : Indicates the path to your « CABundle.cer » file (the one you've just created with the "cat" command).
« ssl_certificate_key » : Indicates the path to your private key file (the file you obtained when you've generated the CSR).
8. Test your Nginx configuration to make sure your configuration file's syntax is valid typing the following command.
9. If everything's ok, you can restart your Nginx server typing
10. You can now test your SSL certificate.Buy cheap SSL certificates for Nginx