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 <daniel.kaestner@cas.de> Co-authored-by: Dexter192 <DanielKaestner@otlook.de>
This commit is contained in:
parent
61e345a029
commit
9191773957
2 changed files with 6 additions and 2 deletions
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;'
|
||||
Loading…
Add table
Add a link
Reference in a new issue