Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

438
Vistas
413 Request Entity Too Large - Elastic Beanstalk + Load Balancer + Node.js application

I have looked on all possible stackoverflow posts and have tried all the different aproaches. None worked. There seems also no official documentation on this. Everything works fine in my local app, and I can upload images of any size, but as soon as its deployed in my elastic beanstalk, I seem to have a limit of 1M per image upoad.

The Problem: Every time a user posts an image that is larger than 1MB, I receive the 413 error message with nginx.

Elastic Beanstalk Log: 2020/07/28 17:22:53 [error] 10404#0: *62 client intended to send too large body: 2800500 bytes, client: 172.31.18.162, server: , request: "POST /comment/image_post/11003031 HTTP/1.1", host: "myapp.com", referrer: "https://myapp.com/11003031"

What I did to try to solve the problem:

I created a .ebextensions folder in my node,js application root folder, added the below code and called it proxi.config, and pushed it to my github which deploys to Elastic Beanstalk via pipeline. I can see the proxi.config in my repository but for some reason it is automatically overwritten by the load balancer (I guess from what I have been reading).

    proxi.config
container_commands:
  01_reload_nginx:
    command: "service nginx reload"
files:
    "/etc/nginx/conf.d/proxy.conf":
      mode: "000755"
      owner: root
      group: root
      content: |
        client_max_body_size 25M;

If this is complicated to solve, is there no other way to increase the 1M limit?

over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

The probable reason why your proxy.conf is not being used is because you are using current version of EB, which runs on Amazon Linux 2 (AL2). However, the proxy settings you are trying to use are for old version of EB running on AL1.

For AL2, the nginx settings should be placed in .platform folder, not in .ebextenations as shown in the docs.

Thus you can try the following:

File .platform/nginx/conf.d/myconfig.conf with the content of

client_max_body_size 25M;

Please note that I can't verify the nginx setting it self. It still may not work as it may be wrong setting or have wrong form. But the use of .ebextenations instead of .platform is definitely an issue on AL2 EB environments.

over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda