Write directory title here
background
I have nothing to do recently, and I want to build a Wordpress on my server as a backup blog. After the operation, I found that my blog does not support https, which leads to various browsers crazily prompting that it is not safe. I found out that Alibaba Cloud can apply for an SSL certificate for free. I plan to apply for a set of free certificates, review the configuration of the server by the way, and record how to apply and configure the SSL certificate.
Preparation
- Apply for an SSL certificate
- Backup website database
Apply for a certificate
1. Open the Alibaba Cloud management console and find the SSL certificate page. If you can’t find it, you can directly type keywords in the search interface to see it. Click Buy Certificate, and click Go to the purchase page in the pop-up interface.
2. Select the cloud shield certificate resource package, click the free certificate expansion package, and you can get 20 single-domain SSL certificates.
Modify nginx configuration
1. Download the corresponding certificate file
2. After the certificate is downloaded, upload it to the website directory. For convenience, you can modify the file name of the certificate and key.
3. Configure the certificate. Since the website uses the LNMP one-key installation package, use the command directly Just add vhost
4. After the addition is complete, restart the nginx server and rewrite the 301 jump rule.
5. Enter the Wordpress background and install the plug-in Really Simple SSL to enable SSL on the whole site
Certificate Expiration Replacement
Since Alibaba Cloud’s free certificate is renewed every year, after applying for a new certificate upon expiration, name the new certificate the name of the old certificate, put it directly into the file folder and restart the nginx server, no need to reset.
achieve effect
common problem
Q: After the completion, it still prompts that the connection is not safe.
A: 1. Check whether the certificate status is valid. Alibaba Cloud certificates may sometimes be invalid, just re-apply and replace the file.
2. Restart the browser or clear the browser cache and visit again.
If you have other questions, please leave a message in the comment area.