Installing the Software
Yum Install openssll Nginx
Generate a certificate under a specific directory
Mkdir/usr/share/nginx/conf
Cd/usr/share/nginx/conf
OpenSSL genrsa-des3-out Server.key 1024
Generate the server-side private key Server.key
OpenSSL Req-new-key server.key-out SERVER.CSR
The generated CSR file is sent to the CA to form the service side's own certificate, enter the certificate information, country, region, company, mailbox, etc.
OpenSSL rsa-in server.key-out Server_nopwd.key
command to remove key file password, generate a key without password protection
OpenSSL x509-req-days 365-in server.csr-signkey server_nopwd.key-out server.crt
Configure Nginx
Vi/etc/nginx/conf.d/default.conf
server {
Listen 443;
SSL on;
SSL_CERTIFICATE/USR/SHARE/NGINX/CONF/SERVER.CRT;
Ssl_certificate_key/usr/share/nginx/conf/server_nopwd.key;
}
Nginx Re-load configuration
/etc/init.d/nginx Reload
This article is from the "Cloud Notepad" blog, please be sure to keep this source http://youngcloud.blog.51cto.com/2873694/1662855
Nginx Install HTTPS support