先获取公网IP地址
登录后
sudo apt install nginx
mkdir web # 改为你想要放的地址,记得不能是root目录下
cd web
vim index.html # 编辑网页
往里面写入简单的hello word!
<!DOCTYPE html>
<html>
<head>
<title>hello world</title>
</head>
<body>
hello world!
</body>
</html>
打开浏览器云服务器的控制台找到安全组
点击安全组其中一个,再点击手动添加写入
保存再次登录云服务器
vim /etc/nginx/sites-available/default
找到其中的 root /var/www/html
改为 root /web # 你想要显示html的目录,记得不能是root目录下
退出,重新启动nginx
/etc/init.d/nginx restart
然后在浏览器输入你的公网地址就可以看到hello word!了