Skip to content

Commit 49ecec3

Browse files
committed
fix: normalize max request size for nginx
1 parent 9308879 commit 49ecec3

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

deploy/docker/frontend/01-update-nginx-conf.sh

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,16 @@ else
1818
ln -s /etc/nginx/nginx-http.conf /etc/nginx/nginx.conf
1919
fi;
2020

21-
sed -i "s@__LOWCODER_MAX_REQUEST_SIZE__@${LOWCODER_MAX_REQUEST_SIZE:=20m}@" /etc/nginx/nginx.conf
21+
# Normalize max. request size for usage with nginx
22+
MAX_REQUEST_SIZE=$(echo "${LOWCODER_MAX_REQUEST_SIZE:=20m}" | perl -pe 's/^([ \t]*)(?<number>\d+(\.\d+)?)([ \t]*)(?<unit>[kKmMgGtT]{1})?([bB \t]*)$/"$+{number}" . lc($+{unit})/e')
23+
24+
25+
sed -i "s@__LOWCODER_MAX_REQUEST_SIZE__@${MAX_REQUEST_SIZE}@" /etc/nginx/nginx.conf
2226
sed -i "s@__LOWCODER_MAX_QUERY_TIMEOUT__@${LOWCODER_MAX_QUERY_TIMEOUT:=120}@" /etc/nginx/server.conf
2327
sed -i "s@__LOWCODER_API_SERVICE_URL__@${LOWCODER_API_SERVICE_URL:=http://localhost:8080}@" /etc/nginx/server.conf
2428
sed -i "s@__LOWCODER_NODE_SERVICE_URL__@${LOWCODER_NODE_SERVICE_URL:=http://localhost:6060}@" /etc/nginx/server.conf
2529

2630
echo "nginx config updated with:"
27-
echo " Lowcoder max upload size: ${LOWCODER_MAX_REQUEST_SIZE:=20m}"
31+
echo " Lowcoder max upload size: ${MAX_REQUEST_SIZE:=20m}"
2832
echo " Lowcoder api service URL: ${LOWCODER_API_SERVICE_URL:=http://localhost:8080}"
2933
echo " Lowcoder node service URL: ${LOWCODER_NODE_SERVICE_URL:=http://localhost:6060}"

0 commit comments

Comments
 (0)