通过ebextensions用aws弹性beanstalk中的nginx替换apache

I've succesfully configured an AWS elasticbeanstalk application with apache ,now i want to replace the apache with nginx server.

I'cant find a proper tutorial ,some of them says that login to your associated ec2 instance and install nginx manually,but i don't think its the right way because elastic beanstalk provides (Modify/add programs via ebextensions folder and config file)

So i am looking for a solution that uses .ebextensions config files.

This seems to be what you're looking for: Changing Apache to Nginx with PHP FPM on Elastic Beanstalk – Amazon Web Services.

Edit: Another possibility is to create a Custom Platform for Elastic Beanstalk.