首页 > 解决方案 > AWS ElasticBeanstalk Amazon Linux 2 .platform 文件夹未复制 NGINX conf

问题描述

我一直在使用 Amazon Linux 2 迁移到 ElasticBeanstalk,但在覆盖默认 nginx.conf 文件时遇到问题。我正在关注反向代理的AL2 文档

他们说,“要完全覆盖 Elastic Beanstalk 默认 nginx 配置,请在源包中的 .platform/nginx/nginx.conf 中包含一个配置:”

我的应用程序文件夹结构

在此处输入图像描述

但是,当我运行部署时,出现错误

CommandService Response: {"status":"FAILURE","api_version":"1.0","results":[{"status":"FAILURE","msg":"Engine execution has encountered an error.","returncode":1,"events":[{"msg":"Instance deployment: Elastic Beanstalk ignored your '.ebextensions/nginx' configuration directory. To include these configuration files, move them to '.platform/nginx'.","timestamp":1598554657,"severity":"WARN"},{"msg":"Instance deployment failed. For details, see 'eb-engine.log'.","timestamp":1598554682,"severity":"ERROR"}]}]}

错误的主要部分是

"Elastic Beanstalk 忽略了您的 '.ebextensions/nginx' 配置目录。要包含这些配置文件,请将它们移动到 '.platform/nginx'。""

我对此感到困惑,因为这是我放置文件/文件夹的地方。

我尝试完全删除 .ebextensions 文件夹并得到同样的错误。

我尝试从一个全新的豆茎环境开始,但仍然出现该错误。我不明白豆茎是如何管理这个的。

标签: node.jsamazon-web-servicesnginxamazon-elastic-beanstalk

解决方案


根据评论。

该问题是由配置文件的重复位置引起的。nginx这是由于删除了 中的 nginx 默认路径.ebextensions,而 EB 重新创建了它。

由于这似乎是一个错误,因此创建了勾选 AWS 支持。


推荐阅读