EBS Log:
Instance deployment completed successfully.
Then:
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: 172.31.39.121, server: , request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:8081/", host: "demo.myproduct.com"
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: {
id: 'XXXXXXXXXXXXXXXXXXXXXX',
secret: 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
},
sslDomains: ['demo.myproduct.com'],
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: 'https://demo.myproduct.com',
PORT: 80,
SESSION_TIMEOUT_SECONDS: 900,
MONGO_URL: 'mongodb+srv://myproduct_app:XXXXXXXXXXXX@myproduct-demo.abcdefg.mongodb.net/myproduct?retryWrites=true&w=majority',
MONGO_OPLOG_URL: 'mongodb+srv://oplog_reader:XXXXXXXXXXXX@myproduct-demo.abcdefg.mongodb.net/local',
MAIL_URL: 'smtp://app@mg.myproduct.com:XXXXXXXXXXXXXXXXXXXXXXXXX@smtp.mailgun.org:587',
METEOR_SIGTERM_GRACE_PERIOD_SECONDS: 30
}
},
plugins: ['mup-aws-beanstalk']
}