MUP + mup-aws-beanstalk - ELB Failing Health Check

EBS Log:
Instance deployment completed successfully.
Instance id(s) 'i-0f7f000000008f9' did not pass health check after command execution. Aborting the operation.

Following the trail of crumbs to the nginx error log:

2024/05/16 03:37:54 [error] 3477#3477: *1191 connect() failed (111: Connection refused) while connecting to upstream, client:, server: , request: "GET / HTTP/1.1", upstream: "", host: ""

I seem to be missing something about how the PORT assignments should be configured. The ELB is heathy, active, and listening on ports 80 & 443 and properly routing all requests to the instance(s) on port 80 that nginx is apparently listening on. The AWS Reachability Analyzer confirms this. nginx then tries connecting to my upstream Meteor app for some reason on port 8081?!

I tried setting the Meteor PORT to 8081, but when I mup reconfig nginx then switched to looking for an Upstream Server on port 8039?! I tried env.PORT: 80 with no luck.

The instance’s Public IPv4 DNS address gets a: ERR_CONNECTION_TIMED_OUT

Why is nginx even in the mix? The AWS ELB is already doing the load balancing and handling the SSL. So how should I be configuring mup & mup-aws-beanstalk to simply have the ELB communicate directly to my Meteor app’s listening port? (or have nginx proxying on the proper ports)?

MY CONFIG ======================================

Meteor v2.16
mup v1.5.10
mup-aws-beanstalk v0.8.0

module.exports = {
    app: {
        type: 'aws-beanstalk',
        name: 'MYPRODUCT-DEMO',
        path: '../',
        minInstances: 1,
        instanceType: 'm6gd.medium',
        auth: {
        sslDomains: [''],
        forceSSL: true,
        envName: 'demo-myproduct',
        oldVersions: 3,
        docker: {
            image: 'zodern/meteor:root',
            prepareBundle: true,
            stopAppDuringPrepareBundle: true
        buildOptions: {
            serverOnly: true,
            buildLocation: 'H:/myproduct-build'
        env: {
            ROOT_URL: '',
            PORT: 80,
            MONGO_URL: 'mongodb+srv://',
            MONGO_OPLOG_URL: 'mongodb+srv://',
            MAIL_URL: 'smtp://',
    plugins: ['mup-aws-beanstalk']

Hi @cormip, I dropped a short reply on your Github issue too.
I don’t use docker but from my experience with Beanstalk, there are configurations that must be done in AWS directly and can’t be passed directly from your Meteor deployment. However there is a lot that can be done from Meteor side with MUP but I don’t see a customBeanstalkConfig in your script.
This reference to port 8081: might be related to the internal Healthcheck within AWS.
A couple of things I would do:

  1. Extend the port range for Healthcheck to 200-399
  2. Make sure in the security group inbound policy for your machine, you allow 80 from the sg-… of your ELB.
    Unfortunately, I don’t think I could help you with this type of async forum conversation so if you don’t manage to fix it, we could have a look together.
    If you are already a Beanstalk pro, please disregard my comments as they are addressed, I guess, to more entry level users.

SOLVED: I’d missed a somewhat cryptic error entry when reviewing mup beanstalk logs. My “production” REDIS server didn’t have the same user permissions as my development REDIS server, so my app failed to start. Once I fixed the REDIS issue, the app started up, and everything works.

1 Like