HTTPS for my site
I have a website https://www.novaself.com and without noticing my SSL certificate expired, this caused that every visit to the website was received with a problematic message like this one:
To fix this problem I renewed my SSL certificate but now I need to install the new certificate in my website.
Before I begin
If you need the private key file (.key) and the certificate signing request file (.csr), the easiest way is to install openssl and run:
openssl genrsa -out www.domain.com.key 2048
openssl req -new -key www.domain.com.key -out www.domain.com.csrLast command will prompt a few questions, like below:
Country Name (2 letter code) [AU]:US
State or Province Name (full name) [Some-State]:Texas
Locality Name (eg, city) []:Dallas
Organization Name (eg, company) [Internet Widgits Pty Ltd]:DuckyDucks
Organizational Unit Name (eg, section) []:IT
Common Name (eg, YOUR name) []:www.domain.com
Email Address []:admin@domain.comThe Common Name is the most important field, that should be the exact domain name for which you are requesting SSL, in most cases, it should be “www.domain.com”. If you are buying for a subdomain, then it should be something like “subdomain.domain.com”. If for wildcard, it should be “*.domain.com”.
Get Daniel Blanco Rojas’s stories in your inbox
Join Medium for free to get updates from this writer.
After you finish, you should have 2 files now, www.domain.com.key and www.domain.com.csr.
Now goto GoDaddy’s site, and buy the SSL. Use the generated files to setup your certificate within GoDaddy and download the SSL certificate (zip file).
Installing the new certificate
After downloading my certificate from my provider I have the following files:
5c24e1396dce188.crt
gd_bundle-g2-g1.crtI need to combine both files into one file, with my domain ssl file on top.
cat 5c24e1396dce188.crt gd_bundle-g2-g1.crt > www.novaself.com.crtIf I don’t combine them, browser will not be able to verify certificate authority (CA), and popup dialog or warning messages, which will certainly scare my site visitors away (what is happening right now).
Now I’m going to upload my combined crt file into my server and setup my nginx.conf to look like this:
ssl_certificate /path/to/ssl/www.novaself.com.crt;
ssl_certificate_key /path/to/ssl/ssl/www.novaself.com.key;After that I just need reload nginx to make the change take effect.
sudo nginx -s reload





