Installing an SSL certificate on Nginx
I remember the first time I installed an SSL certificate on Nginx. I was quite surprised by how straightforward it was! I'm not sure why I expected a big drama but happily there was nothing of the sort.
I'm not sure if these steps are the simplest or the most up-to-date, but by Christ they work!
The first step is obviously to buy an SSL certificate.
You'll be prompted for a certificate signing request, so let's generate one of those now on the command line of our own computer:
At this point OpenSSL should prompt you for some information, which you can enter as applicable:
Paste your CSR into the GoDaddy admin panel and you should then be able to download a bundle of files. Download and extract that bundle and then combine the CRT files into one. The names of the files might be different to those below but the idea is we want to combine both of the
.crt files together into a single file:
Both files that we need to go onto the server are now ready. Put the
.crt file here on the server:
.key file here on the server:
With the files in place it should now just be a case of adding a few lines to the ngix config file. Most probabaly you have a file like
/etc/sites-enabled/mysite that contains your config. It needs the following lines to enable SSL and use the certificate we want it to: