node.js – Node JS application on Elastic Beanstalk is not allowing to upload large file

I have deployed a Node JS application onto the AWS Elastic Beanstalk environment. My application has a file upload logic. When I tried to upload large file from the Front End, it is throwing error basically complaining that it does not accept large file as follow.

<head><title>413 Request Entity Too Large</title></head>
<center><h1>413 Request Entity Too Large</h1></center>

To fix the issue I created a .ebextensions folder in the root directory and created a file called nginx.config with the following content.

    content: "client_max_body_size 512m;"
    group: root
    mode: "000644"
    owner: root

Then I deployed the zip file again to the Beanstalk. Then I tried uploading the file again. It is still throwing the same error.

This time I tried changing nginx.config file content to this.




content: |

client_max_body_size 512M;


It is still throwing the same error. How can I fix this issue?

Source link