【发布时间】:2018-03-09 14:53:45
【问题描述】:
我目前有一个私人托管的 docker 镜像,可以正常工作。 在容器中,我运行一个 ASP.NET Web API Core 应用程序。
AWS 有 NGINX,当 Elastic Beanstalk 启动时,有时当我上传应用程序的新版本时,它会返回此错误。谁能指出我做错了什么?
-------------------------------------
/var/log/nginx/error.log
-------------------------------------
2017/09/27 12:02:53 [emerg] 3161#0: no host in upstream "docker" in /etc/nginx/conf.d/elasticbeanstalk-nginx-docker-upstream.conf:21
这是我的 Dockerrun.aws.json
{
"AWSEBDockerrunVersion": "1"
}
.ebextensions/00_nginx.config 文件
files:
"/etc/nginx/sites-available/elasticbeanstalk-nginx-docker-proxy-timeout.conf" :
mode: "000755"
owner: root
group: root
content: |
upstream docker {
server 127.0.0.1:52940;
keepalive 360;
}
client_max_body_size 100G;
proxy_connect_timeout 3600;
proxy_send_timeout 3600;
proxy_read_timeout 3600;
client_body_timeout 3600;
client_header_timeout 360;
send_timeout 3600;
keepalive_timeout 360;
container_commands:
01-restart-nginx:
command: /sbin/service nginx restart
还有我的 Dockerfile
FROM microsoft/aspnetcore:1.1
LABEL name "<my_application>"
WORKDIR /app
ENV ASPNETCORE_URLS http://*:52940
EXPOSE 52940
ENTRYPOINT ["dotnet", "<my_application>.dll"]
COPY out .
【问题讨论】:
标签: amazon-web-services docker nginx amazon-elastic-beanstalk