我无法在我的 nginx 服务器上建立与端口 443 的连接。
我需要端口 443 来启用 https 连接,我使用 certbot 来安装 ssl 证书,我使用默认安装和本指南中的默认说明
即使我已将“nginx full”命令设置为同时打开 http 和 https 端口,我还是通过运行以下命令仔细检查以确保端口 443 确实打开sudo lsof -i -P -n | grep LISTEN
,并且在响应中,我得到端口 443 正在使用通过 nginx
我尝试使用 cURL 之类的工具来测试我的端口,端口 80 工作得很好,但是端口 443 没有响应
我缺乏服务器管理经验,我试图检查其他资源,但我不知道还能做什么。
我的站点可用配置:
server {
root /var/www/muhammed-aldulaimi.com/html;
index index.html index.htm index.nginx-debian.html;
server_name muhammed-aldulaimi.com www.muhammed-aldulaimi.com;
location / {
try_files $uri $uri/ =404;
}
listen [::]:443 ssl ipv6only=on; # managed by Certbot
listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/muhammed-aldulaimi.com/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/muhammed-aldulaimi.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
}
server {
if ($host = www.muhammed-aldulaimi.com) {
return 301 https://$host$request_uri;
} # managed by Certbot
if ($host = muhammed-aldulaimi.com) {
return 301 https://$host$request_uri;
} # managed by Certbot
listen 80;
listen [::]:80;
server_name muhammed-aldulaimi.com www.muhammed-aldulaimi.com;
return 404; # managed by Certbot
}
ufw状态:
22/tcp ALLOW Anywhere
Nginx Full ALLOW Anywhere
22/tcp (v6) ALLOW Anywhere (v6)
Nginx Full (v6) ALLOW Anywhere (v6)