阿里百川 应用服务器nodejs项目部署后不能访问
发布于 9 年前 作者 stevenxzw 5580 次浏览 最后一次编辑是 8 年前 来自 问答

最近看到阿里百川 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 回复

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

@naruto900814 端口改什么都一样

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

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

回到顶部