title: Gunicorn on EC2 keeps giving WORKER TIMEOUT when called externally
body: <p>I am trying to get my flask app running on gunicorn fronted by nginx. I wanted to test things as I go so I got everything working using the flask development server internally and externally to aws. I then started up gunicorn and tired it. A simple call to /status, which returns 'running' worked, but the workers kept timing out and restarting.</p>
  
  <p>I rolled up my sleeves, and started simplifying. I can now reproduce this with a simple wsgi script:</p>
  
  <pre><code>def application(env, start_response):
  start_response('200 OK', [('Content-Type', 'text/html')])
  return ["Hello!"]
  </code></pre>
  
  <p>The gunicorn command line that I have is:</p>
  
  <pre><code>var/www/py_api/app/var/www/py_api/venv/bin/python /var/www/py_api/venv/bin/gunicorn -b &lt;private_IP&gt;:4000  test_server
  </code></pre>
  
  <p>I have tried to bind to 0.0.0.0 with similar results. Binding to 127.0.0.1 only works internally, but does not reproduce the problem.</p>
  
  <p>I am running everything on Ubuntu 12.04 on an EC2 medium in the default VPC.</p>
  
  <p>I am running everything out of virtualenv. Here is the pip freeze output:</p>
  
  <pre><code>Babel==1.3
  Flask==0.10.1
  Flask-Babel==0.9
  Flask-Login==0.2.10
  Flask-Mail==0.9.0
  Flask-SQLAlchemy==1.0
  Flask-User==0.4.9
  Flask-WTF==0.9.5
  Jinja2==2.7.2
  MarkupSafe==0.21
  SQLAlchemy==0.9.4
  WTForms==1.0.5
  Werkzeug==0.9.4
  argparse==1.2.1
  awscli==1.3.11
  bcdoc==0.12.2
  blinker==1.3
  botocore==0.45.0
  colorama==0.2.5
  docutils==0.11
  hashids==1.0.0
  itsdangerous==0.24
  jmespath==0.4.1
  oursql==0.9.3.1
  passlib==1.6.2
  py-bcrypt==0.4
  pyasn1==0.1.7
  pycrypto==2.6.1
  python-dateutil==2.2
  pytz==2014.2
  requestes==0.0.1
  requests==2.3.0
  rsa==3.1.2
  six==1.6.1
  speaklater==1.3
  virtualenv==1.11.4
  wsgiref==0.1.2
  </code></pre>
  
  <p>I am reluctant to move forward with nginx until I get this resolved.</p>
  
  <p><strong>Summery</strong>: 
  If I curl locally everything works fine. If I curl from external, either through a ELB or direct to the machine, I get timeouts. It is not just curl.</p>
  
  <p><strong>Theory</strong>: 
  I have ready about problems with Gunicorn and elbs, I am wondering if the change to putting all ec2 instances in at least a default vpc, means that any external traffic goes through a transparent elb.</p>