'AWS beantalk custom AMI to include GZIP compression on AL2

I'm migrating a bunch of applications to AL2 on beanstalk and have noticed that gzip compression is no longer supported with the new platform.

I understand I can enable gzip via the .ebextensions file in the app but this is a chore I'd rather avoid if possible.

As a relative newcomer to beanstalk, I'm wondering if it's possible to instead create a custom AMI with the configuration that enables gzip to avoid the .ebextension work. My current understanding is that this may not be possible as beanstalk sets up and configures nginx as part of its startup script - is anyone aware of a workaround at all?

Thanks in advance.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source