5

I'm trying to submit a form with a file to Node+Express server. I set the bodyParser limit to 5M:

app.use(express.bodyParser({ limit: '5mb' }));

It works fine on local machine. However on Heroku I get "Request Entity Too Large" error for files larger than 1M.

How does Heroku put this limit and how it can be changed?

EDIT: The actual error is generated by the nginx and not the node app: enter image description here

grigy
  • 6,206
  • 11
  • 46
  • 74
  • 2
    I don't think they have a limit, per se, but you might try more I was wondering the same with wordpress on heroku. But now php.ini and wp-config.php are both set to 1000mb for max-file size and uploads and nginx.conf 'client_max_body_size 1000m;'. maybe there's another express property which heroku defaults unless you override? – irth Nov 12 '14 at 06:01

2 Answers2

2

I forgot to post the resolution. The problem was only for that app. I tried to create a new app and it worked fine. So I think it was related to the specific server instance that the initial application was using. On another instance the problem didn't exist.

grigy
  • 6,206
  • 11
  • 46
  • 74
0

You might need to re-order you configuration statements, see this answer: https://stackoverflow.com/a/19965089/2942

Community
  • 1
  • 1
friism
  • 18,110
  • 5
  • 72
  • 114
  • I tried that already. The problem is that it works fine on local machine. It does not work only on Heroku. – grigy Nov 15 '14 at 17:26