segunda-feira, março 14, 2022

Changing default load balance settings nginx in elastic beanstalk


Scenario

imagine a .net core api hosted on linux that needs to upload files from 6 to 10 Mb (considering the resolution of the cell phone cameras is still very little).

You prepare your beanstalk environment, connect to the instance via terminal and adjust the nginx.conf to support files larger than 10 megs from the client-max-body-size property to the size you see fit.

However, with each new deployment of your API, the nginx settings go back to the initial default, losing its configuration.

The solution is to create a structure within your api project and create a configuration file with just the parameters you need to adjust, the structure should look like this:

-->.ApiProject\.platform\nginx\conf.d\elasticbeanstalk\proxy.conf



Don't forget to configure so that this file is always present in the release: