简体   繁体   中英

How to modify or add new Nginx configuration in Tomcat AWS Elastic beanstalk (Spring Boot Application)

I had a Spring Boot Application and it was deployed in the AWS Elastic beanstalk (Tomcat server). It was a war deployment.

I need to change the Nginx configuration. Need to add client_max_body_size 50M; to the configuration. While checking the AWS Documentation found a way to modify the configuration via placing config file in .platform/nginx location in the project root. I tried and it was not working.

Then I found these files are not picking while war creation. I can explain the build process too.

  1. Code build will generate the war file
  2. Uploading this war to S3
  3. Creating Application version (By uploading this war to the ELB)
  4. Pointing the that version to the elastic beanstalk environment.

Can anyone help me to find a solution to change the nginx config in ELB for war deployment?

Thank in advance!

If you are using Amazon Linux version 2, you need to put nginx config into following path:

.platform/nginx/conf.d/config.conf

If you are using Amazon Linux version 1, location should be:

.ebextensions/nginx/conf.d/config.conf

This folder (.platform/.ebextension) should be inside Zip file (which contains your war/jar and this.platform/.ebextension folder) to work.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM