How to setup ssl in nginx when certificate requested from digital certificate authority ?
To set up ssl we need to generate two files
1. certificate key file (*.key)
2. certificate signing request (*.csr)
To generate your csr file execute the following command on your terminal
openssl req -new -newkey rsa:2048 -nodes -keyout yourdomain.key -out yourdomain.csr
Fill up the required information like domain name,state,common name. Save your key file in a safe place as we need it later.
Send yourdomain.csr file to certifice authority. They will send you 2 certificate files.
Suppose you get two certificate files
1. DigiCertCA.crt
2. www_your_domain.crt
combine these two certificate to single one.
cat www_your_domain.crt DigiCertCA.crt >> yourdomain.crt
Make sure you put them in right order. DigiCertCA.crt is a intermediate certificate file. so you should put it in second.
Now, open nginx configuration file and edit these two lines.(Give correct path to crt and key file)
ssl_certificate /etc/ssl/certs/yourdomain.crt; # combination of two certificate
ssl_certificate_key /etc/ssl/private/yourdomain.key;
If result is not found or irrelevant, Please contact us.
Submit your request