Legacy Knowledge Base
Published Jul. 2, 2025

Unable to download files bigger than 1GB: "upstream prematurely closed connection while reading upstream"

Written By

Jose Jimenez

How To articles are not official guidelines or officially supported documentation. They are community-contributed content and may not always reflect the latest updates to Liferay DXP. We welcome your feedback to improve How To articles!

While we make every effort to ensure this Knowledge Base is accurate, it may not always reflect the most recent updates or official guidelines.We appreciate your understanding and encourage you to reach out with any feedback or concerns.

Legacy Article

You are viewing an article from our legacy "FastTrack" publication program, made available for informational purposes. Articles in this program were published without a requirement for independent editing or verification and are provided"as is" without guarantee.

Before using any information from this article, independently verify its suitability for your situation and project.

Issue

  • You can not download big files from the Liferay DXP, in general you can have problems with files bigger than 1 GB, as commonly are some LAR files.
  • There is an error in the webserver service's log file similar to:
    [error] 75#75: *344298 upstream prematurely closed connection while reading upstream, client: 95.169.229.129, server: , request: "GET /documents/portlet_file_entry/20124/P%C3%A0gines_p%C3%BAbliques_2-20210210061050249.lar/b900a824-f425-16b2-92da-3c1dfa65038e?download=true HTTP/1.1", upstream: "http://127.0.0.1:81/documents/portlet_file_entry/20124/


Resolution

  • By default, the WebServer service has enabled the buffering of responses from the proxied server using a temporary file that it has a 1024 M max size
  • You can increase that limit or disable the buffering since the liferaycloud/nginx:1.16.1-4.0.3 by adding the LCP_WEBSERVER_PROXY_MAX_TEMP_FILE_SIZE environment variable to the service.
  • The values are in megabytes, the default value is 1024, and 0 can be used for disabling the buffering.
  • Eg. Check the image version of the webserver/LCP.json and set the environment variable:
    ...
    "env": {
    "LCP_WEBSERVER_PROXY_MAX_TEMP_FILE_SIZE": "0"
    }
    ...

 

Additional Information

Did this article resolve your issue ?

Legacy Knowledge Base