1 Answer
- Newest
- Most votes
- Most comments
0
It turns out that even though the Elastic Beanstalk web console is showing my setup as having an nginx proxy, for multicontainer docker + docker compose, it doesn’t use an Elastic Beanstalk proxy, so I needed to have my own nginx container report this information.
There is helpful info in these:
- How to generally have container logs mounted properly: https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/create_deploy_docker.container.console.html#docker-env-cfg.healthd-logging
- How to set up your own nginx to log in the right format: https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/health-enhanced-serverlogs.html#health-enhanced-serverlogs.configure
After all that I had my own nginx logging healthd info to NGINXDIR="/var/log/eb-docker/containers/nginx/healthd"
and an empty directory HEALTHDDIR="/var/log/nginx/healthd"
, so I created an .ebextensions script that:
- Does
mkdir -p "$NGINXDIR" && chmod 777 "$NGINXDIR"
(would love to hear advice on a tighter perms and/or user/group owners for that directory) - Sets up a symlinks in the HEALTHDDIR pointing to my NGINXDIR:
if [ -L "$HEALTHDDIR" ]; then
echo "is symlink: $HEALTHDDIR"
else
mv "$HEALTHDDIR" "$BACKUPDIR"
echo "moved $HEALTHDDIR to $BACKUPDIR"
ln -s "$NGINXDIR" "$HEALTHDDIR"
echo "linked $NGINXDIR to $HEALTHDDIR"
fi
Seems to be working now and I’m now seeing data in the “Nxx Responses” and “PNN Latency” columns, which are reading from the last 10 seconds and updating regularly.
answered 2 years ago
Relevant content
- asked a year ago
- asked 8 months ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 6 months ago
- AWS OFFICIALUpdated 2 years ago