Skip to content
Merged
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
10 changes: 10 additions & 0 deletions nginx/files/01-listen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,16 @@ CONF="${NGINX_INCLUDE_DIR}/listen.conf"
# ensure include file exists
mkdir -p "${NGINX_INCLUDE_DIR}" && : > "$CONF"

# error out if certs are present but base url is not https based
if [ -f "/etc/nginx/certs/cert.pem" ] && [ -f "/etc/nginx/certs/key.pem" ]; then
case "$BASE_URL" in
http://*)
echo "BASE_URL starts with http://, but SSL certificate is present. Please update your env variables!"
exit 1
;;
esac
fi

if [ -f "/etc/nginx/certs/cert.pem" ] && [ -f "/etc/nginx/certs/key.pem" ]; then
# ipv4-ssl
printf 'listen %s ssl;\n' "${NGINX_INTERNAL_HTTPS_PORT}" >> "$CONF"
Expand Down