【发布时间】:2021-07-01 09:28:30
【问题描述】:
我已经在 AWS EC2、Ubuntu 20.04 服务器上设置了 Nginx。我使用了以下命令:
# add nodejs 10 ppa (personal package archive) from nodesource
curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash -
# install nodejs and npm
sudo apt-get install -y nodejs
# install nginx
sudo apt-get install -y nginx
echo "
----------------------
UFW (FIREWALL)
----------------------
"
# allow ssh connections through firewall
sudo ufw allow OpenSSH
# allow http & https through firewall
sudo ufw allow 'Nginx Full'
# enable firewall
sudo ufw --force enable
但是,我仍然无法访问 URL http://IP_ADRESS。
可能是什么问题?
【问题讨论】:
-
也许你还没有启用和启动 nginx?
sudo systemctl enable nginx && sudo systemctl start nginx -
我也已经完成了这一步
-
然后用
sudo journalctl -u nginx检查nginx的输出 -
还是不行... journalctl 没有显示任何问题
标签: node.js amazon-web-services nginx amazon-ec2