4

wordpress | 将 wordpress 的 http 变成 https

 6 months ago
source link: https://benpaodewoniu.github.io/2024/03/08/wordpress10/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

wordpress | 将 wordpress 的 http 变成 https

我的架构如下

注册账号后进行申请,然后验证,如图

10_0.png

然后把相关内容填写到域名解析那里

10_1.png

如果通过验证,那么你会下载一些文件,将文件上传到服务器上,比如,我就是 /home/ubuntu/https

然后,nginx 开始配置

server {
listen 80;
## Your website name goes here.
server_name thlm.bond www.thlm.bond;
listen 443 ssl default_server;
listen [::]:443 ssl default_server;#新增这两个
ssl_certificate /home/ubuntu/https/fullchain.crt; # 路径和你上传保持一致
ssl_certificate_key /home/ubuntu/https/private.pem; # 路径和你上传保持一致
...
}

上面的搭建可知,我的配置文件是 /etc/nginx/sites-available/wordpress.conf

但是,我上面的配置,如果想要强制把 http 转为 https,总会出错。


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK