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