一、修改nginx配置
vi /etc/nginx/sites-available/default
server{
listen 443 ssl; #ssl不能少,否则报错
server_name yourdomain.com;
ssl_certificate /etc/letsencrypt/live/ yourdomain.com /fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/ yourdomain.com/privkey.pem;
ssl_session_timeout 5m;
ssl_protocols SSLv3 TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers “HIGH:!aNULL:!MD5 or HIGH:!aNULL:!MD5:!3DES”;
ssl_prefer_server_ciphers on;
location / {
proxy_pass https://127.0.0.1:4430;
}
}
或者
server{
listen 80;
server_name 127.0.0.1 localhost yourdomain.com ;
# rewrite ^(.*)$ https://$host$1 permanent;
location / {
proxy_pass https://127.0.0.1:4430;
}
}
二、注意
# wordpress 一直以为配置失败,其实是wordpress没有修改路径为https
三、刷新 systemctl reload nginx使配置生效