AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / user-829818

momomo's questions

Martin Hope
momomo
Asked: 2021-09-12 14:52:40 +0800 CST

为什么我在使用 Certbot 安装 SSL 证书后无法访问我的网站?(运行 Ubuntu 和 Nginx)

  • 1

我无法在我的 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)
ubuntu nginx certbot
  • 1 个回答
  • 685 Views

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve