Configuring nginx in a single docker container environment (AWS ElasticBeanstalk)


I am currently deploying a Django + uWSGI app using a single container docker environment in AWS ElasticBeanstalk. This environment already ships with nginx, which I am currently trying to configure.

I am trying to achieve the following:

  1. Terminate HTTPS at the environment’s load balancer
  2. Redirect HTTP requests to HTTPS using nginx (which is shipped with the environment)
  3. Pass requests from nginx to uwsgi

Environment information:

  • Configuration and Solution Stack Name: Single Container Docker 1.11
    version 2.3.0
  • AMI: 64bit Amazon Linux 2016.09 v2.3.0 running Docker
  • Docker Version: 1.11.2
  • Proxy Server: nginx 1.10.1

This is my current configuration:




application.ini (uwsgi config)

Now, when testing the configuration:

Checking works fine

Checking doesn’t work as expected. It redirects fine, but it then hangs until the request times out.


Following @deviavir’s suggestion, I needed to allow traffic from the load balancer into the EC2 instance.

This is my final configuration:



Leave a Reply