InsideDarkWeb.com

Elasticbeanstalk Customize Nginx through ebextension

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.

Server Fault Asked by psabbate on November 22, 2021

1 Answers

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!

Related Questions

How can I install nspr 4.25 on CentOS 7?

1  Asked on December 18, 2020 by drteeth

     

Postfix Rewrite domain only after transport process

0  Asked on December 16, 2020 by nerigal

 

How to debug CGI over fcgiwrap/nginx

1  Asked on December 16, 2020 by googlebot

       

Limit access on Apache 2.4 to ldap group

1  Asked on December 15, 2020 by jakobbg

     

Enabling jumbo frame on tg3

0  Asked on December 15, 2020 by gli-illuminati

     

Postfix does not retry after 451 error / greylisting

2  Asked on December 14, 2020 by assylias

       

OpenVPN over dynamic IPv6

1  Asked on December 14, 2020 by hellstorm

   

autossh does not kill ssh when link down

1  Asked on December 13, 2020

   

Is it safe to write batch files with Unix line endings?

4  Asked on December 13, 2020 by cmcginty

   

Ask a Question

Get help from others!

© 2021 InsideDarkWeb.com. All rights reserved.