How to run a celery worker with Django app scalable by AWS Elastic Beanstalk?

This is how I set up celery with django on elastic beanstalk with scalability working fine. Please keep in mind that ‘leader_only’ option for container_commands works only on environment rebuild or deployment of the App. If service works long enough, leader node may be removed by Elastic Beanstalk. To deal with that, you may have … Read more

AWS Elastic Beanstalk environment variables in ASP.NET Core 1.0

I just implemented a slightly other solution which injects the beanstalk environment variables to the program so that you may access them by Environment.GetEnvironmentVariable(): private static void SetEbConfig() { var tempConfigBuilder = new ConfigurationBuilder(); tempConfigBuilder.AddJsonFile( @”C:\Program Files\Amazon\ElasticBeanstalk\config\containerconfiguration”, optional: true, reloadOnChange: true ); var configuration = tempConfigBuilder.Build(); var ebEnv = configuration.GetSection(“iis:env”) .GetChildren() .Select(pair => pair.Value.Split(new[] { … Read more

How to get Elastic Beanstalk nginx-backed proxy server to auto-redirect from HTTP to HTTPS?

After several false-starts with ideas from Amazon’s paid support, they did come through in the end. The way you get this to work is you configure your environment to respond to both port 80 and 443. Then create a folder in your main Node.js app folder called .ebextensions, and you place a file named 00_nginx_https_rw.config … Read more

Nginx config file overwritten during Elastic Beanstalk deployment?

After spending almost entire day and trying out all the possible solutions, as of July 17, 2017, the above solution does not work. For me, I wanted to replace /etc/nginx/conf.d/elasticbeanstalk/00_application.conf I created the below shown folder structure in my .ebextension folder and the file was overwritten with my content. This solution also worked for nginx.conf … Read more