title: Nginx fail on Docker deployment to Amazon
body: <p>I am trying to deploy .net asp web api application in Docker container to Amazon via elasticbeanstalk, but here is what I got:</p>
  
  <pre><code>ERROR: Failed to start nginx, abort deployment
  ERROR: [Instance: i-ecf0d365] Command failed on instance. Return code: 1 Output: nginx: [emerg] invalid host in upstream "172.17.0.2:5000/tcp" in /etc/nginx/conf.d/elasticbeanstalk-nginx-docker-upstream.conf:2
  nginx: configuration file /etc/nginx/nginx.conf test failed
  </code></pre>
  
  <p>Image is here: <a href="https://hub.docker.com/r/wedkarz/awsm8-api/" rel="nofollow">https://hub.docker.com/r/wedkarz/awsm8-api/</a></p>
  
  <h2>Dockerfile</h2>
  
  <pre><code>FROM microsoft/aspnet:latest
  
  COPY . /app
  WORKDIR /app
  RUN ["dnu", "restore"]
  
  EXPOSE 5000/tcp
  ENTRYPOINT ["dnx", "-p", "project.json", "web"]
  </code></pre>
  
  <h2>elasticbeanstalk-nginx-docker-upstream.conf file</h2>
  
  <pre><code>upstream docker {
      server 172.17.0.2:5000/tcp;
      keepalive 256;
  }
  </code></pre>