1

This is happening from last 1 week whenever my old elastic beanstalk instance getting terminated and AWS spinning up new instance its not picking eb extensions where I have mentioned.

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

due to which I am not able to upload any video from my APIs.

TylerH
  • 20,799
  • 66
  • 75
  • 101
Cycl0n3
  • 611
  • 1
  • 6
  • 25
  • Can you define not working? Had there been any code change since the last instance change? – Chris Williams Aug 12 '20 at 17:00
  • no Chris there is not any code change aws has just terminated the previous instance and launched the new one as we have auto scaling enabled – Cycl0n3 Aug 13 '20 at 06:43
  • Not working - when i am trying to upload a video using my api its throwing ngnix 413 error – Cycl0n3 Aug 13 '20 at 06:44
  • 1
    This is a duplicate of https://stackoverflow.com/a/61943622/7532917 i have answered it there. Please check – Jijo Cleetus Aug 18 '20 at 21:10
  • Awesome worked for me @JijoCleetus can you please post the solution here also the question is specific to "new instance its not picking .ebextensions" and will help other users – Cycl0n3 Aug 19 '20 at 10:43

1 Answers1

2

This can be achieved using .platform folder.

.platform/
         nginx/
              conf.d/
                    proxy.conf
         00_myconf.config

Content of File 1 - proxy.conf (Inside .platform/nginx/conf.d/ folder)

client_max_body_size 50M;

Content of File 2 - 00_myconf.config (Inside .platform/ folder)

container_commands:
  01_reload_nginx:
    command: "service nginx reload"

Redeploy your app to elastic beanstalk and it will provide this configuration to all the new elastic beanstalk instances.

Jijo Cleetus
  • 2,679
  • 1
  • 11
  • 17
  • 1
    Just to add a little bit of context, this seems to be the way to do it on Amazon Linux 2, where as what OP had was a valid way to do it in Amazon Linux. Took me awhile to figure out this was the root cause. – Josh Foskett Aug 12 '21 at 21:25