diff --git a/setup/start/nginx/appconfig.ejs b/setup/start/nginx/appconfig.ejs index 170c61950..76d3fd164 100644 --- a/setup/start/nginx/appconfig.ejs +++ b/setup/start/nginx/appconfig.ejs @@ -80,9 +80,6 @@ server { # No buffering to temp files, it fails for large downloads proxy_max_temp_file_size 0; - # Disable check to allow unlimited body sizes - client_max_body_size 0; - <% if (robotsTxtQuoted) { %> location = /robots.txt { return 200 <%- robotsTxtQuoted %>; @@ -107,6 +104,11 @@ server { proxy_read_timeout 30m; } + location ~ ^/api/v1/apps/.*/upload$ { + proxy_pass http://127.0.0.1:3000; + client_max_body_size 0; + } + # graphite paths (uncomment block below and visit /graphite/index.html) # location ~ ^/(graphite|content|metrics|dashboard|render|browser|composer)/ { # proxy_pass http://127.0.0.1:8000; diff --git a/src/server.js b/src/server.js index 95916ba2f..f5c6766e1 100644 --- a/src/server.js +++ b/src/server.js @@ -81,7 +81,7 @@ function initializeExpressSync() { .use(middleware.lastMile()); // NOTE: these limits have to be in sync with nginx limits - var FILE_SIZE_LIMIT = '1mb', // max file size that can be uploaded (see also client_max_body_size in nginx) + var FILE_SIZE_LIMIT = '256mb', // max file size that can be uploaded (see also client_max_body_size in nginx) FILE_TIMEOUT = 60 * 1000; // increased timeout for file uploads (1 min) var multipart = middleware.multipart({ maxFieldsSize: FIELD_LIMIT, limit: FILE_SIZE_LIMIT, timeout: FILE_TIMEOUT });