Wordpress full site SSL and Alibaba Cloud application for free SSL certificate

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

  1. Apply for an SSL certificate
  2. 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.
insert image description here
2. Select the cloud shield certificate resource package, click the free certificate expansion package, and you can get 20 single-domain SSL certificates.
insert image description here

Modify nginx configuration

1. Download the corresponding certificate file
insert image description here
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
insert image description here
4. After the addition is complete, restart the nginx server and rewrite the 301 jump rule.
insert image description here
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

insert image description here

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.

Guess you like

Origin blog.csdn.net/qq_20728575/article/details/113932987