TransWikia.com

Elasticbeanstalk Customize Nginx through ebextension

Server Fault Asked by psabbate on November 22, 2021

I have been literally all day fighting with this, I just need to increase the client_max_body_size in my Nginx Configuration.

I have a tomcat configuration (custom ami) and I tried this so far.

  • creating a file in /etc/nginx/conf.d/my-http.conf
  • creating a file in /tmp and then move it to the above location
  • creating the filesystem in my source code
    .ebextensions/nginx/conf.d/my-http.conf

Here is the latest (desperate) file I tested (named .ebextensions/http_conf.config)

files:
  "/tmp/http.conf.tmp" :
    mode: "000644"
    owner: root
    group: root
    content: |
      client_max_body_size 10M;

  "/etc/nginx/conf.d/proxy.conf":
    mode: "000755"
    owner: root
    group: root
    content: |
      client_max_body_size 20M;      

container_commands:
  01_remove_current_http_conf:
    command: "rm -f /etc/nginx/conf.d/http.conf"
  02_cp_new_http_conf:
    command: "cp /tmp/http.conf.tmp /tmp/http.conf.tmp2"
  03_cp_new_http_conf2:
    command: "cp /tmp/http.conf.tmp /etc/nginx/conf.d/http.conf"

So as you can see, I’m trying everything, let me share the results of this.

  • I can see a file created at /tmp/http.conf.tmp
  • I can’t see a file created at /etc/nginx/conf.d/proxy.conf
  • I can see a file created at /tmp/http.conf.tmp2
  • I can’t see a file created at /etc/nginx/conf.d/http.conf

I’m guessing the directory is overwritten after I create those files somehow, but I couldn’t find a way to avoid that.

One Answer

Create .config file extension that you place in a folder named .ebextensions and deploy in your application source bundle. Please refer client-max-body-size-in and Beanstalk Configuration Files (.ebextensions)

Answered by sanjayparmar on November 22, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP