下面是我的nginx配置。我修改了‘默认’文件(它放在‘网站-可用)。我能够访问网站时,它是通过'http’。但是当我尝试使用'https‘时,会出现连接超时,无法到达页面。奇怪的是,Nginx没有对日志进行任何条目( access.log和error.log)。我是在寻求帮助,因为我对此完全陌生。
# 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;
}
}发布于 2022-01-24 13:11:06
443端口在aws ec2中开放
经过两天没完没了的乞讨,我明白了这个问题。我没有在EC2安全组中打开443端口。无论是谁遇到类似的问题,->都要记住,确保操作系统防火墙允许通过443进行连接,同时也要确保实例允许通过443进行连接。

https://stackoverflow.com/questions/70831890
复制相似问题