Certbot SSL 证书不起作用

Certbot SSL certificate doesn't work

我已经成功设置了 Nginx。我的网站可以通过 http 访问。之后我安装了 certbot 证书。安装时没有错误。

我现在的配置中有什么:

listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/dev.mydomainname.com/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/dev.mydomainname.com/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot

输入带有 https 前缀的站点结果 "ERR_CONNECTION_TIMED_OUT"。

443 端口正在侦听。

sudo ufw status:

To                         Action      From
--                         ------      ----
Nginx HTTP                 ALLOW       Anywhere
22                         ALLOW       Anywhere
Nginx HTTP (v6)            ALLOW       Anywhere (v6)
22 (v6)                    ALLOW       Anywhere (v6)

怎么办?

您没有让 Nginx https 流量通过您的防火墙。
首先,授予 Nginx 完全防火墙访问权限:sudo ufw allow 'Nginx Full'
删除 Nginx http:sudo ufw delete allow 'Nginx HTTP'
这应该可以解决您的问题。