Aws弹性豆茎502坏门方式

时间:2018-06-08 17:00:49

标签: amazon-web-services bad-gateway

我正在尝试使用RDS(mysql)和使用代理作为nginx在bean stalk中部署快速应用程序,我正在收听5000帖子。

我还尝试将app.js中的端口更改为8081,以便进入坏门方式,我还登录到了Elactic bean stalk的ec2盒子,我将脚本配置为" node app.js& #34;在package.json文件中,但2天仍有同样的问题!...

我能够通过允许使用端口172.31.44.154'""""""""在默认vpc的安全组中

enter image description here

然后当我在ecs实例中运行节点app.js时,我得到以下错误:

enter image description here

when i look my logs it says :
 2018/06/08 16:24:49 [error] 4800#0: *63 connect() failed (111: Connection refused) while connecting to upstream, client: 79.143.112.236, server: , request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:8081/", host: "52.20.46.199:80" 

2018/06/08 16:48:16 [error] 4800#0: *65 connect() failed (111: Connection refused) while connecting to upstream, client: 187.155.142.19, server: , request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:8081/", host: "52.20.46.199:80"

下面是我的app.js:

var express = require('express');
var bodyParser = require('body-parser');
var cors = require('cors');
var database = require('./app/lib/database');
var taskController = require('./app/task/taskController');


// Defining variables
var SERVER_PORT = 5000;

var app = express();


// applying middlewares
app.use(bodyParser.urlencoded({ extended: true }));
app.use(bodyParser.json());
app.use(cors());

package.json:

{
  "name": "express-todo-app",
  "version": "1.0.0",
  "description": "",
  "main": "app.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
    "start": "node app.js"
  },
  "author": "",
  "license": "ISC",
  "dependencies": {
    "body-parser": "^1.17.2",
    "cors": "^2.8.4",
    "express": "^4.15.3",
    "mysql": "^2.15.0"
  },
  "devDependencies": {
    "chai": "^4.1.0",
    "mocha": "^3.4.2",
    "supertest": "^3.0.0"
  }
}

0 个答案:

没有答案