I need to upload large files to the server (some of them reach 1GB) and I get this error:
<html>
<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>
I know this error comes from ningx, and I need to increaste
client_max_body_size
I created a .ebextensions folder with this structure:
.ebextensions/nginx/conf.d/proxy.conf
Also I created a .platform folder with the same structure
.platform/nginx/conf.d/proxy.conf
proxy.conf contains:
client_max_body_size 999M;
After doing that and deploying it keeps throwing the same error.
The platform (created by elastic beanstalk) is
Linux/UNIX
I can see in the logs (eb-engine.log) this, but Im not sure if it is because of what I did:
2022/09/22 11:00:35.780593 [INFO] Executing instruction: start proxy
with new configuration 2022/09/22 11:00:35.780613 [INFO] Running
command /bin/sh -c /usr/sbin/nginx -t -c
/var/proxy/staging/nginx/nginx.conf 2022/09/22 11:00:35.803451 [INFO] nginx: the configuration file /var/proxy/staging/nginx/nginx.conf
syntax is ok nginx: configuration file
/var/proxy/staging/nginx/nginx.conf test is successful
Thanks!
2
Answers
For anyone facing the same issue. I was actually doing it okey, but I missed moving the .platform folder to the dist/ folder in the build step. So I just did:
in the postbuild step.
You should be using
.platform
, not.ebextensions
. For example:.platform/nginx/conf.d/myconfig.conf