diff --git a/server-ce/init_scripts/200_nginx_config_template.sh b/server-ce/init_scripts/200_nginx_config_template.sh index f5707260ce..741acfdf1c 100755 --- a/server-ce/init_scripts/200_nginx_config_template.sh +++ b/server-ce/init_scripts/200_nginx_config_template.sh @@ -20,6 +20,7 @@ if [ -f "${nginx_template_file}" ]; then export NGINX_KEEPALIVE_TIMEOUT="${NGINX_KEEPALIVE_TIMEOUT:-65}" export NGINX_WORKER_CONNECTIONS="${NGINX_WORKER_CONNECTIONS:-768}" export NGINX_WORKER_PROCESSES="${NGINX_WORKER_PROCESSES:-4}" + export MAX_UPLOAD_SIZE_NGINX="${MAX_UPLOAD_SIZE:-50}m" echo "Nginx: generating config file from template" @@ -31,6 +32,7 @@ if [ -f "${nginx_template_file}" ]; then ${NGINX_KEEPALIVE_TIMEOUT} ${NGINX_WORKER_CONNECTIONS} ${NGINX_WORKER_PROCESSES} + ${MAX_UPLOAD_SIZE_NGINX} ' \ < "${nginx_template_file}" \ > "${nginx_config_file}" diff --git a/server-ce/nginx/nginx.conf.template b/server-ce/nginx/nginx.conf.template index 639937f41c..007e1a1e9e 100644 --- a/server-ce/nginx/nginx.conf.template +++ b/server-ce/nginx/nginx.conf.template @@ -46,7 +46,7 @@ http { gzip_disable "msie6"; gzip_proxied any; # allow upstream server to compress. - client_max_body_size 50m; + client_max_body_size ${MAX_UPLOAD_SIZE_NGINX}; # gzip_vary on; # gzip_proxied any; diff --git a/services/web/config/settings.defaults.js b/services/web/config/settings.defaults.js index 2473d03cb3..6a089f6198 100644 --- a/services/web/config/settings.defaults.js +++ b/services/web/config/settings.defaults.js @@ -368,7 +368,7 @@ module.exports = { process.env.PROJECT_UPLOAD_TIMEOUT || '120000', 10 ), - maxUploadSize: 50 * 1024 * 1024, // 50 MB + maxUploadSize: parseInt(process.env.MAX_UPLOAD_SIZE || '50', 10) * 1024 * 1024, // MB multerOptions: { preservePath: process.env.MULTER_PRESERVE_PATH, }, @@ -1154,4 +1154,4 @@ module.exports.oauthProviders = { linkPath: '/oidc/login', }, }), -} \ No newline at end of file +}