feat(nginx): Enable upstream keepalive (#1206)

* Enable keepalive

* Adapt envsubst

* Fix shellcheck issues

* Lower connection count
This commit is contained in:
otbutz
2022-12-30 03:09:38 +01:00
committed by GitHub
parent 10b0924cfb
commit b584185f0f
2 changed files with 21 additions and 3 deletions

View File

@@ -2,8 +2,16 @@
set -e
export IMMICH_WEB_URL=${IMMICH_WEB_URL:-http://immich-web:3000}
IMMICH_WEB_SCHEME=$(echo "$IMMICH_WEB_URL" | grep -Eo '^https?://' || echo "http://")
export IMMICH_WEB_SCHEME
IMMICH_WEB_HOST=$(echo "$IMMICH_WEB_URL" | cut -d '/' -f 3)
export IMMICH_WEB_HOST
export IMMICH_SERVER_URL=${IMMICH_SERVER_URL:-http://immich-server:3001}
IMMICH_SERVER_SCHEME=$(echo "$IMMICH_WEB_URL" | grep -Eo '^https?://' || echo "http://")
export IMMICH_SERVER_SCHEME
IMMICH_SERVER_HOST=$(echo "$IMMICH_SERVER_URL" | cut -d '/' -f 3)
export IMMICH_SERVER_HOST
envsubst '$IMMICH_WEB_URL $IMMICH_SERVER_URL' < /etc/nginx/nginx.conf.template > /etc/nginx/nginx.conf
envsubst '$IMMICH_WEB_SCHEME $IMMICH_WEB_HOST $IMMICH_SERVER_SCHEME $IMMICH_SERVER_HOST' < /etc/nginx/nginx.conf.template > /etc/nginx/nginx.conf
exec nginx -g 'daemon off;'