Testing self-signed SSL certificates
Start by executing the following command to generate a key
OpenSSL Genrsa-des3-out1024x768
Then he will ask you to enter the password for this key file. Input is not recommended. Because it will be used for nginx later. Each time you reload Nginx configuration, you need to verify this Pam password.
Because the password must be entered at the time of generation. You can type and then delete.
- in Xxx.key- out ssl.keyrm xxx.key
Then generate the certificate request file based on this key file
OpenSSL req-new -key Ssl.key- out SSL.CSR
When the above command to fill a lot of things to read one by one (can casually, after all, this is the certificate of their own generation)
Finally, a CRT certificate file is generated from these 2 files
36500 - in Ssl.csr-signkey ssl.key- out SSL.CRT
Here 36500 is the certificate validity period, this everyone casual. The last file used is the key and the CRT file
The following is the Nginx configuration
upstream MMC {server192.168.0.44:8080weight=Ten;} server {Listen the; server_name aaa.com; Rewrite^/(. *) https://$server _name$1 Permanent;}server {Listen443SSL; server_name aaa.com; SSL on; Ssl_certificate/home/mmc/SSL.CRT; Ssl_certificate_key/home/mmc/Ssl.key; Ssl_session_timeout 5m; Location/{proxy_pass http://MMC; }}
Nginx HTTPS configuration