CNode

阿里百川 应用服务器nodejs项目部署后不能访问

问答
Sstevenxzw发布于11 年前最后回复11 年前5 回复6331 浏览0 收藏

最近看到阿里百川 http://tae.taobao.com/ 可以免费创建Nodejs应用,上去玩了下创建初始化nodejs项目是没问题的,但把自己的代码部署上去就不行了,那怕只是一个简单的“ Hello world ” 都不行。

代码如下: var http = require("http"); http.createServer(function(request, response) { console.log("Request received..."); response.writeHead(200, {"Content-Type": "text/plain"}); response.write("Hello world"); response.end(); }).listen(80);

访问时报的错如下: 502 Bad Gateway

The proxy server received an invalid response from an upstream server. Sorry for the inconvenience. Please report this message and include the following information to us. Thank you very much!

URL: http://ttv1.wx.jaeapp.com/ Server: jaenginx05.am100.aliyun.com Date: 2015/10/10 12:00:35

有谁知道原因?

查看回复

回复 (5)

N
naruto900814#1·11 年前

你的端口号是不是应该监听3000,nginx会占用80吧

S
stevenxzw#2·11 年前
N
naruto900814#3·11 年前
引用 stevenxzw@naruto900814 端口改什么都一样

@stevenxzw 那个控制台不有一个端口监听配置吗?

O
orbury#4·11 年前

QQ图片20151012091225.png

QQ截图20151012091329.png

S
stevenxzw#5·11 年前
引用 orbury

@orbury 原来是8080,终于好了,谢谢

参与回复
登录后即可参与回复。登录