Please follow the below steps to Install and Upgrade the SSL in nginx server:
Step1: Open putty SSH
Step2: Redirect to Domain Config file to find / create the SSL key and SSL crt location.
Step3: Please follow the below step to find view/edit the domain config file.
— Once logged into SSH.
— From current folder, redirect to root folder using below comment.
Comment: cd ..
Also, please check the below image.
—From root folder, redirect to /etc/nginx/conf.d folder to reach the domain.conf file.
Comment: cd etc/nginx/conf.d
— From conf.d folder, list out the all files using below comment to find the domain config file name.
Comment: ls -a (It will list all files)
— Edit the particular domain config file using below comment.
Comment: vi domainname.com.conf
— It will open the Edit view, there we could add SSL key and SSL crt location and Edit. Files name should be domainname.com.crt and domainname.com.key
Please find the below image for more information.
— Click i key to enable the insert mode to edit the file.
— Update the ssl_certificate and ssl_certificate_key path based on your need.
— Click “Esc” and “!wq” and “Enter” to save the changes.
— Create / Go to the SSL folder “etc/nginx/ssl” folder
— Create or edit certificate key file “domainname.com.key” and add the Privare key value as like below image and use below comment.
Comment: vi domainname.com.key
Enable Insert using i key
Add private key
Click Esc key
Enter :wq and click Enter to save the file.
As like below image.
— Same process to add three CERTIFICATE key in same file called “domainname.com.crt”.
— Finally restart the nginx server
Comments for Debian/Ubuntu/RHEL/CentOS Linux
# /etc/init.d/nginx restart
OR
# /etc/init.d/nginx reload
OR
# service nginx restart
OR
# service nginx reload
DONE!!!