diff --git a/center/deploy_startup/nginx.conf b/center/deploy_startup/nginx.conf index 1e8589d70..fbd72ddf8 100644 --- a/center/deploy_startup/nginx.conf +++ b/center/deploy_startup/nginx.conf @@ -1,6 +1,6 @@ #user nobody; -worker_processes 4; +worker_processes auto; #error_log logs/error.log; #error_log logs/error.log notice; @@ -58,8 +58,14 @@ http { location / { proxy_pass http://localhost:9886; + proxy_set_header Host $http_host; + + send_timeout 300s; + # When buffering is disabled, the response is passed to a client synchronously, immediately as it is received. nginx will not try to read the whole response from the proxied server. More details in https://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_buffering + proxy_buffering off; client_max_body_size 2000m; - proxy_set_header Host $http_host; + proxy_request_buffering off; + proxy_socket_keepalive on; } # center ws redirect diff --git a/common/src/main/java/com/microsoft/hydralab/common/file/impl/local/client/LocalStorageClient.java b/common/src/main/java/com/microsoft/hydralab/common/file/impl/local/client/LocalStorageClient.java index 4e4074ca7..6570a561a 100644 --- a/common/src/main/java/com/microsoft/hydralab/common/file/impl/local/client/LocalStorageClient.java +++ b/common/src/main/java/com/microsoft/hydralab/common/file/impl/local/client/LocalStorageClient.java @@ -72,9 +72,8 @@ public String upload(File file, StorageFileInfo storageFileInfo) { body.add("fileUri", fileUri); HttpEntity> entity = new HttpEntity<>(body, headers); - ResponseEntity responseAsStr = restTemplateHttps.exchange(this.getUploadUrl(), HttpMethod.POST, entity, String.class); - JSONObject responseObject = JSONObject.parseObject(responseAsStr.getBody()); - return this.endpoint + Const.LocalStorageURL.CENTER_LOCAL_STORAGE_DOWNLOAD + "/" + responseObject.getString("content"); + ResponseEntity responseObject = restTemplateHttps.exchange(this.getUploadUrl(), HttpMethod.POST, entity, JSONObject.class); + return this.endpoint + Const.LocalStorageURL.CENTER_LOCAL_STORAGE_DOWNLOAD + "/" + responseObject.getBody().getString("content"); } /**