This works for the new AWS Linux 2 environment. To fix this - you need to wrap your configuration file. You should have, if you're using Docker, a zip file (mine is called deploy.zip
) that contains your Dockerrun.aws.json
. If you don't - it's rather easy to modify, just zip your deploy via
zip -r deploy.zip Dockerrun.aws.json
With that - you now need to add a .platform
folder as follows:
APP ROOT
├── Dockerfile
├── Dockerrun.aws.json
├── .platform
│ └── nginx
│ └── conf.d
│ └── custom.conf
You can name your custom.conf
whatever you want, and can have as many files as you want. Inside custom.conf
, you simply need to place the following inside
client_max_body_size 50M;
Or whatever you want for your config. With that - modify your zip to now be
zip -r deploy.zip Dockerrun.aws.json .platform
And deploy. Your Nginx server will now respect the new command
More details here: https://blog.benthem.io/2022/04/05/modifying-nginx-settings-on-elasticbeanstalk-with-docker.html