I am trying to deploy .net asp web api application in Docker container to Amazon via elasticbeanstalk, but here is what I got:
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
Image is here: https://hub.docker.com/r/wedkarz/awsm8-api/
FROM microsoft/aspnet:latest
COPY . /app
WORKDIR /app
RUN ["dnu", "restore"]
EXPOSE 5000/tcp
ENTRYPOINT ["dnx", "-p", "project.json", "web"]
upstream docker {
server 172.17.0.2:5000/tcp;
keepalive 256;
}
The error message nginx: [emerg] invalid host in upstream "172.17.0.2:5000/tcp"
shows an upstream server
parameter with the spurious characters /tcp
following the port number. See upstream module documentation.
@Fishman confirmed that the erroneous parameter appeared within the nginx
configuration file, and that this file was generated from the Dockerfile, and that the problem was corrected by changing the value of the EXPOSE
parameter (within the Dockerfile) from 5000/tcp
to 5000
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With