Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AWS ElasticBeanstalk Amazon Linux 2 .platform folder not copying NGINX conf

I've been moving over to ElasticBeanstalk using Amazon Linux 2 and I'm having a problem overwriting the default nginx.conf file. I'm following the AL2 docs for the reverse proxy.

They say, "To override the Elastic Beanstalk default nginx configuration completely, include a configuration in your source bundle at .platform/nginx/nginx.conf:"

My apps folder structure

enter image description here

When I run my deploy though, I get the error

CommandService Response: {"status":"FAILURE","api_version":"1.0","results":[{"status":"FAILURE","msg":"Engine execution has encountered an error.","returncode":1,"events":[{"msg":"Instance deployment: Elastic Beanstalk ignored your '.ebextensions/nginx' configuration directory. To include these configuration files, move them to '.platform/nginx'.","timestamp":1598554657,"severity":"WARN"},{"msg":"Instance deployment failed. For details, see 'eb-engine.log'.","timestamp":1598554682,"severity":"ERROR"}]}]}

The main part of the error is

"Elastic Beanstalk ignored your '.ebextensions/nginx' configuration directory. To include these configuration files, move them to '.platform/nginx'.""

Which I'm confused about because this is where I've put the file/folder.

I've tried completely removing the .ebextensions folder and got the same error.

I've tried starting from a completely fresh beanstalk environment and still got that error. I'm not understanding how beanstalk is managing this.

like image 328
MillerC Avatar asked Oct 15 '25 15:10

MillerC


1 Answers

Based on the comments.

The issue was caused by duplicate locations of the nginx config file. This was due to deleting the nginx default path in .ebextensions, while EB re-creating it.

Since this seems as a bug, AWS support ticked was created.

like image 141
Marcin Avatar answered Oct 17 '25 04:10

Marcin