Reputation: 4870
I'm switching from nginx to Caddy so I set up Caddy and created a new AMI. When I deploy this AMI to my EB environment, it fails to launch because nginx fails to start during the launch.
Using EB platform Ruby 2.7 running on 64bit Amazon Linux 2, how is it possible to prevent nginx from launching?
Upvotes: 1
Views: 1630
Reputation: 7439
If you choose to modify the default AMI, and not create a new one, then ...to override the Elastic Beanstalk nginx configuration
, add the following line to your nginx.conf
per AWS documentation, do the above "...to pull in the Elastic Beanstalk configurations for Enhanced health reporting and monitoring, automatic application mappings, and static files."
Have a look here... I posted some of those copied sample snippets for you below to walk you through,
nginx default config
,Caddys
extensions // this where you over ride nginx config
include conf.d/elasticbeanstalk/*.conf;
The Tomcat, Node.js, PHP, and Python platforms allow you to choose the Apache HTTPD proxy server as an alternative to nginx. This isn't the default. The following example configures Elastic Beanstalk to use Apache HTTPD.
Example, here we replace the reverse proxy with apache
.ebextensions/httpd-proxy.config (you try caddy)
option_settings:
aws:elasticbeanstalk:environment:proxy:
ProxyServer: apache
Background:
By default it ships with Nginx as the reverse proxy on port 80 to find your app. on EBS. So, you have two options a 1) new Custom AMI
or 2) Modifying your AMI
"...Proxy configuration files provided in the .ebextensions/nginx directory should move to the .platform/nginx platform hooks directory. For details, expand the Reverse Proxy Configuration section in Extending Elastic Beanstalk Linux platforms."
Then look at predeploy
and postdeploy config options
here
Upvotes: 2