Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

599
Visualizações
.Net 5 AWS nginx Linux elastic beanstalk changing client_max_body_size

I am unable to upload a file above 1 megabyte due to the default setting on AWS elastic beanstalk nginx. I have looked online and I have found out that I need to change the client_max_body_size to client_max_body_size 20M to allow for larger files. However, there is no where for me to do this. There is no Nginx config file on .net. I am using .net 5 and I then use aws toolkit on visual studio 19 to upload it to elastic beanstalk. the only config file that I can see is the aws-beanstalk-tools-defaults.json.

{
 "region" : "eu-west-2",
 "configuration" : "Release",
 "framework"     : "net5.0",
 "self-contained" : false,
 "application"    : "testapplication",
 "environment"    : "testapplication-prod-env",
 "enable-xray"    : false,
 "enhanced-health-type" : "basic",
 "additional-options"   : "",
 "proxy-server"         : "nginx",
 "solution-stack"       : "64bit Amazon Linux 2 v2.1.5 running .NET Core",
 "environment-type"     : "LoadBalanced",
 "cname"                : "vitradssltest-prod",
 "instance-type"        : "t3a.nano",
 "key-pair"             : "my key pair for testing",
 "instance-profile"     : "aws-elasticbeanstalk-ec2-role",
 "service-role"         : "aws-elasticbeanstalk-service-role",
 "loadbalancer-type"    : "classic",
 "health-check-url"     : "/"
}

01_nginx.config'

file location

over 4 years ago · Santiago Trujillo
2 Respostas
Responde à pergunta

0

Since you are using 64bit Amazon Linux 2 v2.1.5 running .NET Core nginx is on by default. Thus, I don't see any reason why standard way of customizing nginx wouldn't work for you.

Specifically, the custom settings should be in .platform/nginx/conf.d/ as shown in the docs. Therefore, you can create the following .platform/nginx/conf.d/myconfig.conf file with the content:

client_max_body_size 20M;
over 4 years ago · Santiago Trujillo Relatório

0

This has been achieved before with AWS elastic beanstalk. Although your image may be different, I used the following process:

  • Add a folder at the root of your solution and name it '.ebextensions'
  • Inside that folder, add a new file and name it '01_nginx.config'
  • Update the contents of the file to the following

In a similar solution I worked on, it looked like this:

files:
 "/etc/nginx/conf.d/01_proxy.conf":
  mode: "000644"
  owner: root
  group: root
  content: |
    client_max_body_size 20M;

When you deploy the change to elastic beanstalk, it will read from the ebextensions folder and apply all file updates.

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda