'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?
Solution 1:[1]
I have tried with the help of https://www.youtube.com/watch?v=xlx9vZN3fWs.
Please try to connect to ec2 instance and modify /etc/nginx/ngix.conf file with client_max_body_size 512M; and then restart nginx sudo systemctl restart nginx
FYI: After each redeployment that file will lost the changes.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Hhovhann |
