The quick fix for this is for express/http server to listen on process.env.PORT, not on a hard coded port (e.g. 3000). This can be accomplished in express by using
var express = require(‘express’);
var app = express();
app.set(‘port’, process.env.PORT || 8081);
I could not find any options or commands to configure the port for node in Elastic Beanstalk. At the moment, Nginx on an aws 64 bit linux instance is connecting to port 8081 to the node instance. process.env.PORT is set to 8081. When Express was listening on 3000 the bad gateway error was showing up. The logs/events provided by EB were useful to get to the root of this.