Create a server private key, and the command will let you enter a password:
$ OpenSSL genrsa-des3-out server.key 1024
Create a certificate (CSR) for the signing request:
$ OpenSSL req-new-key server.key-out SERVER.CSR
Remove the required password when loading SSL-supported Nginx and using the above private key:
$ CP Server.key server.key.org
$ OpenSSL rsa-in server.key.org-out Server.key
The last token certificate uses the above private key and the CSR:
$ OpenSSL x509-req-days 365-in server.csr-signkey server.key-out server.crt
server {
Listen 443;
server_name www.baidu.com;
root/var/www/www.baidu.com;
AutoIndex on;
SSL on;
SSL_CERTIFICATE/ETC/NGINX/CERT/SERVER.CRT;
Ssl_certificate_key/etc/nginx/cert/server.key;
Access_log/var/log/nginx/www.baidu.com-access.log main;
Error_log/var/log/nginx/www.baidu.com-error.log warn;
}
This article is from the "Silence" blog, make sure to keep this source http://silencezone.blog.51cto.com/3613477/1867476
Generate a self-signed CA certificate to enable Nginx to support HTTPS