无法使用我的 Digital Ocean droplet 的 IP 地址访问我的网站 [英] Unable to access my website using the IP address of my Digital Ocean droplet

查看:26
本文介绍了无法使用我的 Digital Ocean droplet 的 IP 地址访问我的网站的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在将我的 MERN 应用程序部署到 Digital Ocean Droplet(Ubuntu 20.04 服务器).

I am in the process of deploying my MERN app to a Digital Ocean droplet(Ubuntu 20.04 server).

我已经克隆了我的 GitHub 存储库,安装了依赖项和 pm2.

I have cloned my GitHub repo, installed the dependencies and pm2.

我使用命令 pm2 start server/index.js 启动服务器.然后,当我访问 URL http://134.122.112.22:5000 时,出现以下错误:为什么我无法访问我的网站?

I start the server using the command pm2 start server/index.js. Then when I visit the URL http://134.122.112.22:5000, I get the following error: Why am I not able to access my site?

*请注意,我还没有购买域名.另外我还没有安装NGINX.

我错过了什么吗?

EDIT-1我在防火墙中添加了一个 HTTP 入站规则.然而,我收到了同样的错误.

EDIT-1 I added a HTTP inbound rule in the firewall. Yet, I am receiving the same error.

推荐答案

您缺少 Nginx.端口 80 已打开,但您正在尝试 5000,因此无法正常工作.

You are missing the Nginx. Port 80 is open but you are trying 5000, so won't work.

您可以在防火墙中打开端口 5000 并检查 ufw 防火墙.

You can open port 5000 in the firewall and also check ufw firewall.

ufw status 

并使用命令打开端口

sudo ufw allow 5000

这篇关于无法使用我的 Digital Ocean droplet 的 IP 地址访问我的网站的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆