首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在nginx中通过certbot安装ssl证书后,网站下线。

问在nginx中通过certbot安装ssl证书后,网站下线。
EN

Stack Overflow用户
提问于 2022-01-24 09:51:52
回答 1查看 457关注 0票数 3

下面是我的nginx配置。我修改了‘默认’文件(它放在‘网站-可用)。我能够访问网站时,它是通过'http’。但是当我尝试使用'https‘时,会出现连接超时,无法到达页面。奇怪的是,Nginx没有对日志进行任何条目( access.log和error.log)。我是在寻求帮助,因为我对此完全陌生。

代码语言:javascript
复制
# Please see /usr/share/doc/nginx-doc/examples/ for more detailed examples.

##

# Default server configuration
#
server {
    listen 80;
    listen [::]:80;

    root /var/www/main.x.com/html;

    
    index index.html

    server_name main.x.com;

    location / {
        # First attempt to serve request as file, then
        # as directory, then fall back to displaying a 404.
        try_files $uri $uri/ =404;
    }

}


server {
    listen 443 ssl;

    ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
    ssl_certificate /etc/letsencrypt/live/main.x.com/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/main.x.com/privkey.pem;

    server_name main.x.com;
    access_log /var/log/nginx/access.log;
    error_log /var/log/nginx/error.log;

    location / {
        root /var/www/main.x.com/html;
        index index.html;
    }
}
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2022-01-24 13:11:06

443端口在aws ec2中开放

经过两天没完没了的乞讨,我明白了这个问题。我没有在EC2安全组中打开443端口。无论是谁遇到类似的问题,->都要记住,确保操作系统防火墙允许通过443进行连接,同时也要确保实例允许通过443进行连接。

​

​

票数 6
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/70831890

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档