我正在运行带有 nginx 的 Ubuntu 20.04 实例。我的服务器块如下。(虽然屏蔽了原始域)
server {
listen 80;
listen [::]:80;
# SSL configuration
#
listen 443 ssl;
listen [::]:443 ssl;
ssl_certificate /etc/letsencrypt/live/example.com/cert.pem;
ssl_certificate_key /etc/letsencrypt/live/example.com/privkey.pem;
include /etc/letsencrypt/options-ssl-nginx.conf;
index index.html index.htm index.nginx-debian.html;
server_name example.com;
location / {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
try_files $uri $uri/ =404;
}
}
端口 443 已启用,网站无需 SSL 即可运行。我这里做错了什么?
编辑 1:使用 http 访问时页面正在加载,但使用 https 访问时会导致“连接已超时”错误。