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>
<body>
<center><h1>413 Request Entity Too Large</h1></center>
<hr><center>nginx/1.20.0</center>
</body>
</html>

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

files:
  /etc/nginx/conf.d/00_client_max_body_size.conf:
    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.

[sourcecode]

files:

/etc/nginx/conf.d/proxy.conf:

content: |

client_max_body_size 512M;

[/sourcecode]

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

Source link