Home > OS >  AWS Elasticbean stalk asp.net deployment file upload fails with “413 request entity too large”
AWS Elasticbean stalk asp.net deployment file upload fails with “413 request entity too large”

Time:01-20

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.

CodePudding user response:

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;

CodePudding user response:

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

  • Related