I tried multiple solutions
- I tried to add a .conf file with
client_max_body_size 100M;
to my root application .ebextensions/nginx/conf.d/proxy.conf
but when deploying this to live it give me error
1/18/2023 11:59:22 AM Service:AmazonCloudFormation, Message:[/Resources/AWSEBAutoScalingGroup/Metadata/AWS::CloudFormation::Init/prebuild_0_RisksessAML/files//etc/nginx/conf.d/proxy.conf] 'null' values are not allowed in templates
2.Then i tried the other way by accessing nginx.conf with SSH through putty I updated my conf file and saved it. it works fine but when ever I redeploy my code it replaces the sudo nano /etc/nginx/nginx.conf
file with a new one which do not have the client_max_body_size 100M;
code.
2
Answers
what worked for me was you should be using
.platform/nginx/conf.d/elasticbeanstalk/myconfig.conf
instead of just.platform/nginx/conf.d/myconfig.conf
You should be using
.platform/nginx/conf.d/
, not.ebextentions
to setupclient_max_body_size
as explained in the AWS docs.For example create
.platform/nginx/conf.d/myconfig.conf
with the content of: