Install SSL certificate on Nginx step by step

Although I have installed SSL certificates for several times, every time I google step by step guide. So now I take my own note:

Step 1: Generate key

$ openssl genrsa -des3 -out 1024
Generating RSA private key, 1024 bit long modulus
e is 65537 (0x10001)
Enter pass phrase for
Verifying – Enter pass phrase for

Step 2:  Remove pass phrase from key (otherwise Nginx asks for pass phrase every time it starts)

$ openssl rsa -in -out
Enter pass phrase for
writing RSA key

Step 3: Generate CSR

$ openssl req -new -key -out
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter ‘.’, the field will be left blank.
Country Name (2 letter code) [GB]:
State or Province Name (full name) [Berkshire]:E Sussex
Locality Name (eg, city) [Newbury]:Brighton
Organization Name (eg, company) [My Company Ltd]:Euro Ltd
Organizational Unit Name (eg, section) []:
Common Name (eg, your name or your server’s hostname) []
Email Address []:

Please enter the following ‘extra’ attributes
to be sent with your certificate request
A challenge password []:
An optional company name []:

Step 4: Send CSR to authority and get CRT

Step 5: Download CA intermediate certificate from authroity

Step 6: Concatenate CA intermediate certificate with CRT (CRT on top)

$ cat ca.crt >> my.crt

Step 7: Make necessary changes to Nginx configuration

Nginx only need two file: my.crt (concatenated) and

Leave a comment

Your email address will not be published. Required fields are marked *