-
-
Notifications
You must be signed in to change notification settings - Fork 623
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to download large files #276
Comments
Please share a minimal code example that others can use to replicate your problem. If I had to guess, you are calling
|
Hi @pintsized , function connect()
function proxy_response(response, chunksize)
end The problem is when we hit an api to download a file the api returns 200 ok immediately irrespective of whether the file is downloaded or not. So incase of small files it works fine , but fails for file more than 1.4~4mb in size. Error in upstream server: Please let me know how can handle such scenarios. Thanks, |
This kind of thing can happen if the server is sending a non-compliant response - look for things like a bad Please be aware that this library is reasonably well battle tested. It runs large amounts of reverse proxy traffic in real word scenarios. So it is unlikely to be broken for well formed responses. At the same time, please be aware that it is designed as a relatively low level HTTP driver for OpenResty cosockets. It offers some sanity checking where it can, but a more fully fledged HTTP client (like cURL) would be doing a lot more. In other words, you should be able to expect it to work correctly in compliant scenarios. If something is not working, the first step should be to check your HTTP compliance, end-to-end. In your case, I would focus on determining which of the "body reader" paths it takes. The options are essentially:
For large responses, you really want the second one. |
@pintsized , our deployment setup: Browser >>>> AWS ALB >>>> nginx server using connect/proxy_response method to connect further (deployed in AWS) >>> another nginx server using proxy_pass to connect further (deployed in another datacenter outside of AWS) >>> actual application server. ** Note: ALB uses HTTP2(tried changing to HTTP1.1, but didn't work). Thanks, |
Can you post the response headers you receive before trying to read the body? You can omit anything application specific / sensitive. |
Response Headers from second nginx server: Response from 1st nginx server: |
Hi Team,
I am unable to download large file from upstream server and getting unread data in buffer while setting the keepalive time.
Please can someone help in fixing this issue.
The text was updated successfully, but these errors were encountered: