docker: Make connections per host configurable.

This commit is contained in:
Joachim Bauch 2025-04-24 08:29:27 +02:00
commit 1ce202f987
No known key found for this signature in database
GPG key ID: 77C1D22D53E15F02
2 changed files with 5 additions and 0 deletions

View file

@ -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_<ID>_URL`: Url of backend `ID` (where `ID` is the uppercase backend id).
- `BACKEND_<ID>_SHARED_SECRET`: Shared secret for backend `ID` (where `ID` is the uppercase backend id).
- `BACKEND_<ID>_SESSION_LIMIT`: Optional session limit for backend `ID` (where `ID` is the uppercase backend id).

View file

@ -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"