![无法显示默认 NGINX 页面](https://linux22.com/image/757098/%E6%97%A0%E6%B3%95%E6%98%BE%E7%A4%BA%E9%BB%98%E8%AE%A4%20NGINX%20%E9%A1%B5%E9%9D%A2.png)
我刚刚在我的服务器上安装了 Ubuntu 20.04。我还安装了 Nginx。
我的问题是默认的 Nginx 页面没有显示。而且 UFW 也没有被激活。
你知道这个问题吗?
此站点无法访问 24.76.99.542 响应时间过长。以下是一些提示:
检查连接检查代理和防火墙 ERR_CONNECTION_TIMED_OUT
以下是自动创建的 Netplan 文件的内容:
纳米/etc/netplan/50-cloud-init.yaml
# This file is generated from information provided by the datasource. Changes
# to it will not persist across an instance reboot. To disable cloud-init's
# network configuration capabilities, write a file
# /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg with the following:
# network: {config: disabled}
network:
version: 2
ethernets:
ens3:
dhcp4: true
dhcp6: true
match:
macaddress: fa:16:2e:93:2c:10
mtu: 1500
set-name: ens3
启动 Ubuntu 时显示以下内容:
Welcome to Ubuntu 20.04.1 LTS (GNU/Linux 5.4.0-42-generic x86_64)
* Documentation: https://help.ubuntu.com
* Management: https://landscape.canonical.com
* Support: https://ubuntu.com/advantage
System information as of Mon Sep 7 03:04:50 UTC 2020
System load: 0.0 Processes: 117
Usage of /: 8.4% of 19.21GB Users logged in: 1
Memory usage: 5% IPv4 address for ens3: 84.16.79.142
Swap usage: 0%
0 updates can be installed immediately.
0 of these updates are security updates.
*** System restart required ***
Last login: Mon Sep 7 03:01:03 2020 from 45.83.90.147
答案1
对于 ubuntu,你需要使用 ufw enable 命令启用防火墙,首先使用 ufw allow 22/tcp 添加所需的端口,以便在启用防火墙后进行访问,然后 ufw allow 80/tcp 或 443/tcp
ufw status 将为你提供允许的端口