[英]Access NodeJS server installed on Linux server
I created my App from this boilerplate https://github.com/Bikranshu/express-react-boilerplate我从这个样板https://github.com/Bikranshu/express-react-boilerplate创建了我的应用程序
Now I uploaded it to a live Linux server and Node server is running.现在我将它上传到一个实时的 Linux 服务器并且 Node 服务器正在运行。 Screenshot of running server运行服务器截图
But I am unable to access it through Browser with IP address of server.但是我无法通过带有服务器 IP 地址的浏览器访问它。 http://ip_address:3000 After waiting long in browser it is showing timeout error. http://ip_address:3000在浏览器中等待很长时间后,它显示超时错误。 Please guide me how can I access the node/react app from browser.请指导我如何从浏览器访问节点/反应应用程序。
Server running at <ipaddress>
is a local IP, are you in a different network than the server? Server running at <ipaddress>
是本地 IP,您是否与服务器在不同的网络中? If so, you should be typing https://<public ipaddress>:3000
如果是这样,您应该输入https://<public ipaddress>:3000
UPDATE更新
Hosting services usually only forward port 80 (http) or 443 (https.) This means that your port 3000 is not allowed for public access.托管服务通常只转发端口 80 (http) 或 443 (https)。这意味着您的端口 3000 不允许公开访问。 To fix your problem you need to change the listening port.要解决您的问题,您需要更改侦听端口。
Check line 42 on server/app.js
change 'port'
to "80"
or check package.json
and edit npm start
to set port to 80检查server/app.js
上的第 42 行将'port'
更改为"80"
或检查package.json
并编辑npm start
以将端口设置为 80
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.