安装
sudo apt update
sudo apt install nginx
防火墙设置
- 查看
anson@ubuntu:~$ sudo ufw app list
Available applications:
Nginx Full
Nginx HTTP
Nginx HTTPS
OpenSSH
- 开启
anson@ubuntu:~$ sudo ufw allow 'Nginx HTTP'
Rules updated
Rules updated (v6)
- 状态
anson@ubuntu:~$ sudo ufw status
Status: active
To Action From
-- ------ ----
Nginx HTTP ALLOW Anywhere
OpenSSH ALLOW Anywhere
Nginx HTTP (v6) ALLOW Anywhere (v6)
OpenSSH (v6) ALLOW Anywhere (v6)
ref:https://www.digitalocean.com/community/tutorials/how-to-install-nginx-on-ubuntu-20-04
网友评论