Elastic Beanstalk和Docker启动错误

时间:2017-09-28 01:03:55

标签: amazon-web-services docker nginx elastic-beanstalk

我目前有一个泊坞图像,可以很好地私下托管。 在容器内部,我运行ASP.NET Web API Core应用程序。

AWS有NGINX,并在Elastic Beanstalk启动时向我返回此错误,有时我上传新版本的应用程序时也是如此。任何人都能指出我做错了什么?

for (let story in data.hits) {

这是我的Dockerrun.aws.json

-------------------------------------
/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

.ebextensions / 00_nginx.config文件

{
    "AWSEBDockerrunVersion": "1"
}

和我的Dockerfile

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

1 个答案:

答案 0 :(得分:1)

upstreamhttp块级别的应用程序,并且您的create包含在服务器级别。 http级别包括进入conf.d目录,server级别包括进入sites-available

files:
    "/etc/nginx/conf.d/elasticbeanstalk-nginx-docker-upstream.conf" :
        mode: "000755"
        owner: root
        group: root
        content: |
           upstream docker {
              server 127.0.0.1:52940;
              keepalive 360;
           }
    "/etc/nginx/sites-available/elasticbeanstalk-nginx-docker-proxy-timeout.conf" :
        mode: "000755"
        owner: root
        group: root
        content: |
           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