diff --git a/docker/README.md b/docker/README.md index 06db59f..fdc6c18 100644 --- a/docker/README.md +++ b/docker/README.md @@ -29,6 +29,7 @@ The running container can be configured through different environment variables: - `BACKENDS_ALLOWALL_SECRET`: Secret when `BACKENDS_ALLOWALL` is enabled. - `BACKENDS`: Space-separated list of backend ids. - `BACKENDS_TIMEOUT`: Timeout in seconds for requests to backends. +- `CONNECTIONS_PER_HOST`: Maximum number of concurrent backend connections per host. - `BACKEND__URL`: Url of backend `ID` (where `ID` is the uppercase backend id). - `BACKEND__SHARED_SECRET`: Shared secret for backend `ID` (where `ID` is the uppercase backend id). - `BACKEND__SESSION_LIMIT`: Optional session limit for backend `ID` (where `ID` is the uppercase backend id). diff --git a/docker/server/entrypoint.sh b/docker/server/entrypoint.sh index dfd073d..f9e4a16 100755 --- a/docker/server/entrypoint.sh +++ b/docker/server/entrypoint.sh @@ -252,6 +252,10 @@ if [ ! -f "$CONFIG" ]; then sed -i "/requests to the backend/,/requests to the backend/ s|^timeout =.*|timeout = $BACKENDS_TIMEOUT|" "$CONFIG" fi + if [ -n "$CONNECTIONS_PER_HOST" ]; then + sed -i "s|connectionsperhost =.*|connectionsperhost = $CONNECTIONS_PER_HOST|" "$CONFIG" + fi + if [ -n "$BACKENDS" ]; then BACKENDS_CONFIG=${BACKENDS// /,} sed -i "s|#backends = .*|backends = $BACKENDS_CONFIG|" "$CONFIG"