0

I tried multiple solutions

  1. 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.

muh.rafay
  • 21
  • 4

2 Answers2

2

You should be using .platform/nginx/conf.d/, not .ebextentions to setup client_max_body_size as explained in the AWS docs.

For example create .platform/nginx/conf.d/myconfig.conf with the content of:

client_max_body_size 100M;
Marcin
  • 215,873
  • 14
  • 235
  • 294
  • I tried with .platform/nginx/conf.d/, not .ebextentions this time the application was deployed with no errors it is healthy but I am still getting 413 error – muh.rafay Jan 20 '23 at 07:48
  • @muh.rafay You must have other issues. My answer correctly addresses the problem you reported with `client_max_body_size`. For other issues, please make new question with relevant details. – Marcin Jan 20 '23 at 07:52
0

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

muh.rafay
  • 21
  • 4
  • That's now what AWS docs says. Do you have any link that this is how should it be?. What ever you did, you misunderstood your setup. – Marcin Jan 21 '23 at 06:41