From 9191773957ef67bcb7d69f2039068260ae5b8bf7 Mon Sep 17 00:00:00 2001 From: Dexter192 Date: Tue, 3 Jun 2025 13:53:08 +0200 Subject: [PATCH] fix: Allow upload limit increase in kubernetes deployment (#7664) * Add nginx body size upload limit config * Add nginx body size upload limit config * Rename env variable to match existing max upload * Rename env variable to match existing max upload * Add export of Max_file_size_upload variable * Add unit to max body size * Remove unit from default assignment * Apply comments and move config to default nginx conf template --------- Co-authored-by: daniel.kaestner Co-authored-by: Dexter192 --- docker/frontend/default.conf.template | 1 + docker/frontend/start-nginx.sh | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/docker/frontend/default.conf.template b/docker/frontend/default.conf.template index 9e8bf9c0d..efd23b956 100644 --- a/docker/frontend/default.conf.template +++ b/docker/frontend/default.conf.template @@ -5,6 +5,7 @@ events {} http { include /etc/nginx/mime.types; default_type text/plain; + client_max_body_size ${LANGFLOW_MAX_FILE_SIZE_UPLOAD}M; types { text/html html; diff --git a/docker/frontend/start-nginx.sh b/docker/frontend/start-nginx.sh index 891075e80..28954f88f 100644 --- a/docker/frontend/start-nginx.sh +++ b/docker/frontend/start-nginx.sh @@ -15,16 +15,19 @@ fi if [ -z "$FRONTEND_PORT" ]; then FRONTEND_PORT="80" fi +if [ -z "$LANGFLOW_MAX_FILE_SIZE_UPLOAD" ]; then + LANGFLOW_MAX_FILE_SIZE_UPLOAD="1" +fi if [ -z "$BACKEND_URL" ]; then echo "BACKEND_URL must be set as an environment variable or as first parameter. (e.g. http://localhost:7860)" exit 1 fi # Export variables for envsubst -export BACKEND_URL FRONTEND_PORT +export BACKEND_URL FRONTEND_PORT LANGFLOW_MAX_FILE_SIZE_UPLOAD # Use envsubst to substitute environment variables in the template -envsubst '${BACKEND_URL} ${FRONTEND_PORT}' < /etc/nginx/conf.d/default.conf.template > $CONFIG_DIR/default.conf +envsubst '${BACKEND_URL} ${FRONTEND_PORT} ${LANGFLOW_MAX_FILE_SIZE_UPLOAD}' < /etc/nginx/conf.d/default.conf.template > $CONFIG_DIR/default.conf # Start nginx with the new configuration exec nginx -c $CONFIG_DIR/default.conf -g 'daemon off;' \ No newline at end of file