heroku / heroku-buildpack-nginx

Run NGINX in a Heroku app
244 stars 787 forks source link

File upload limits with heroku-nginx #75

Closed jeffreymonaco closed 3 years ago

jeffreymonaco commented 3 years ago

My app - when deployed to Heroku - is using the heroku-nginx buildpack, and I have the following line in my nginx.conf.erb file

client_max_body_size 10m;

which I have moved around to different sections (http, server, etc...) with no success, i.e. the 10MB limit seems to have no effect. Even placing it in all three http/server/location stanzas of the nginx.conf.erb based on some recommendations in old stackoverflow topics about this nginx configuration parameter.

My app includes an upload route to accept user data for analysis and visualization. The upload is implemented via Dropzone.js with chunking, which works well when tested locally on a development server.

On Heroku with the heroku-nginx buildpack, the upload fails and always throws the following error at approx 2MB in the Heroku app log. (Large file transfers work if I remove the nginx layer.)

2021-04-09T13:41:39.578633+00:00 app[web.1]: 2021/04/09 13:41:39 [error] 23#0: *17 client intended to send too large body: 2000873 bytes, client: 10.7.193.239, The app then shows the following 500 error in the client browser...

Internal Server Error The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.

How can one configure the NGINX layer on Heroku to allow such larger files?

beanieboi commented 3 years ago

hey @jeffreymonaco

I'm sorry, we can't provide support in GitHub issues, please open a support ticket https://www.heroku.com/support

jeffreymonaco commented 3 years ago

Thanks.