Change: Allow for configuring the realip module for nginx to pass the proper IP/Scheme to frappe.

This commit is contained in:
Steven 'Xaroth' Noorbergen
2021-02-17 12:25:41 +01:00
committed by Steven Noorbergen
parent 4bbc8c41cf
commit c2b63661be
2 changed files with 33 additions and 4 deletions

View File

@@ -35,11 +35,26 @@ if [[ -z "$HTTP_TIMEOUT" ]]; then
export HTTP_TIMEOUT=120
fi
if [[ -z "$UPSTREAM_REAL_IP_ADDRESS" ]]; then
export UPSTREAM_REAL_IP_ADDRESS=127.0.0.1
fi
if [[ -z "$UPSTREAM_REAL_IP_RECURSIVE" ]]; then
export UPSTREAM_REAL_IP_RECURSIVE=off
fi
if [[ -z "$UPSTREAM_REAL_IP_HEADER" ]]; then
export UPSTREAM_REAL_IP_HEADER="X-Forwarded-For"
fi
envsubst '${FRAPPE_PY}
${FRAPPE_PY_PORT}
${FRAPPE_SOCKETIO}
${SOCKETIO_PORT}
${HTTP_TIMEOUT}' \
${HTTP_TIMEOUT}
${UPSTREAM_REAL_IP_ADDRESS}
${UPSTREAM_REAL_IP_RECURSIVE}
${UPSTREAM_REAL_IP_HEADER}' \
< /etc/nginx/conf.d/default.conf.template > /etc/nginx/conf.d/default.conf
echo "Waiting for frappe-python to be available on $FRAPPE_PY port $FRAPPE_PY_PORT"