Installation instructions of your SSL Certificate for Nginx
Please follow these instructions to install your SSL certificate on Nginx:
1. Once you received your SSL certificate by e-mail, please copy and paste it into a text file (with Notepad or Wordpad) and save the file with the .crt extension. (Include the tags -----BEGIN CERTIFICATE----- and -----END CERTIFICATE-----).
2. Get your intermediate certificate. Copy and paste the contents into a .crt file by using a text editor software (such as Notepad or Wordpad).
3. Concatenate the two certificates by running the following command:
cat intermediatecert.crt >> yoursslcertificate.crt
4. Edit the Nginx virtual host file for the website you are securing. If you need your site to be accessible through both secure (https) and non-secure (http) connections, you will need a server module for each type of connection. Make a copy of the existing non-secure server module and paste it below the original. Then add the lines in bold below:
server {
listen 443;
ssl on;
ssl_certificate /etc/ssl/your_domain_name.crt;
ssl_certificate_key /etc/ssl/your_domain_name.key;
server_name your.domain.com;
access_log /var/log/nginx/nginx.vhost.access.log;
error_log /var/log/nginx/nginx.vhost.error.log;
location / {
root /home/www/public_html/your.domain.com/public/;
index index.html;
}
}
Note: your_domain_name.crt is your SSL certificate file (from step 1) and your_domain_name.key is the key file generated when you created the CSR.
5. Restart Nginx. (You can type the following command: sudo /etc/init.d/nginx restart)