我已经成功设置了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)
该怎么办?
答案 0 :(得分:2)
您不让Nginx https流量通过防火墙。
首先,给Nginx完整的防火墙访问权限:sudo ufw allow 'Nginx Full'
。
删除Nginx http:sudo ufw delete allow 'Nginx HTTP'
这应该可以解决您的问题。