相关疑难解决方法(0)

502 Bad Gateway在Elastic Beanstalk上部署Express Generator模板

我使用快速生成器来创建一个简单的快速应用程序,当在dev上启动时,在localhost:3000上运行正常.

但是,当我使用eb命令 - git aws.push将其推送到弹性beanstalk时,我在生产服务器上遇到502错误.

查看日志,我得到的错误是:

2014/04/01 19:29:40 [error] 24204#0: *1 connect() failed (111: Connection refused) while connecting to upstream, client: 172.31.2.178, server: , request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:8081/", host: "macenvexp-env-hqv9ucmzev.elasticbeanstalk.com"
2014/04/01 19:29:40 [error] 24204#0: *1 connect() failed (111: Connection refused) while connecting to upstream, client: 172.31.2.178, server: , request: "GET /favicon.ico HTTP/1.1", upstream: "http://127.0.0.1:8081/favicon.ico", host: "macenvexp-env-hqv9ucmzev.elasticbeanstalk.com"
Run Code Online (Sandbox Code Playgroud)

我正在使用默认的nginx配置.当我运行没有Express的node.js示例应用程序时,它工作正常.这是app.js中的快速代码:

var express = require('express');
var http = require('http');
var path = require('path');
var favicon = require('static-favicon');
var logger = require('morgan');
var …
Run Code Online (Sandbox Code Playgroud)

nginx amazon-web-services node.js express

57
推荐指数
3
解决办法
3万
查看次数

未知或重复参数:NodeCommand

我正在尝试使用 Elastic beanstalk 部署 Node.js API。

我想设置节点命令来启动应用程序。

这是我的 nodecommand.config:

option_settings:
  aws:elasticbeanstalk:container:nodejs:
    NodeCommand: "npm start"
Run Code Online (Sandbox Code Playgroud)

这是我的文件结构: 在此处输入图片说明

每当我尝试运行时eb deploy,都会收到此错误:

2020-05-13 19:03:44    INFO    Environment update is starting.      
2020-05-13 19:03:48    ERROR   "option_settings" in one of the configuration files failed validation. More details to follow.
2020-05-13 19:03:48    ERROR   Unknown or duplicate parameter: NodeCommand 
2020-05-13 19:03:48    ERROR   Failed to deploy application.        

ERROR: ServiceError - Failed to deploy application.
Run Code Online (Sandbox Code Playgroud)

amazon-web-services amazon-elastic-beanstalk

16
推荐指数
2
解决办法
6067
查看次数