Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

602
Views
.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 answers
Answer question

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 Report

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!