Issue a self-signed certificate
First, make sure you have the OpenSSL library installed
1. First create a working directory
2. Use openssl to create a server private key, and enter the corresponding prompt information
openssl genrsa -des3 -out server.key 1024 #(server is defined by itself)
After entering the password twice, re-enter the confirmation password again. Remember this password, it will be used later
3: Create a Certificate Signing Request
openssl req -new -key server.key -out server.csr
Enter according to the prompt information.
4: Clear the prompt to enter the key when starting Nginx with SSL
cp server.key server.key.org
openssl rsa -in server.key.org -out server.key
5: Use the private key and CSR just generated for certificate signing
openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt
Generate 4 points file
Then configure the certificate into nginx.
Finally restart nginx access to try