Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions src/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,15 @@ if [[ -n $PROXY_REVERSE_URL ]]; then
export UPSTREAM_SERVER=${PROXY_REVERSE_URL#http://}
fi

# Add EC2 IPv4 address to allowed hosts so that load balancers can talk to us
if [[ "$SERVER_NAME" != "_" ]]; then
local_ipv4=$(curl --connect-timeout 2 -s http://169.254.169.254/2009-04-04/meta-data/local-ipv4 || true 2>/dev/null)
if [[ -n "$local_ipv4" ]]
then
export SERVER_NAME="$SERVER_NAME $local_ipv4"
fi
fi

run-parts --exit-on-error /docker-entrypoint.d

exec "$@"