AWS Elastic Beanstalk .ebestensions/nginx/nginx.conf 未覆盖 AWS 的默认值 nginx.conf

AWS Elastic Beanstalk .ebestensions/nginx/nginx.conf not overriding AWS' default nginx.conf

我有一个 AWS 环境,我正在尝试覆盖使用的 nginx.conf。

根据 their documentation,这可以通过在 .ebextensions/nginx/nginx.conf

包含您自己的文件来完成

To override Elastic Beanstalk's default nginx configuration completely, include a configuration in your source bundle at .ebextensions/nginx/nginx.conf

我这样做没有用。我已经尝试创建一个全新的应用程序环境以确保它不是由于实例未完全重新启动,但原始 nginx.conf 仍在使用。我还有另一个 .ebextensions/ 配置文件,它正在按预期创建一个文件。

关于为什么我的 nginx.conf 没有服用的任何线索?我可以提供任何可能提供一些见解的细节吗?我在 eb-activity.log 中搜索了错误,但没有找到任何错误。它确实说它 inflated .ebextensions/nginx/ 目录和 created .ebextensions/nginx/nginx.conf 文件在日志中,它对源包中的其余文件/目录也是如此。不过,它没有任何地方表明它试图使用我的 nginx.conf。

我查看的文档专门针对 java 环境。该方法适用于其他几个环境,但节点环境启动过程不同并忽略该文件。我想这是因为服务器指令在 00_elastic_beanstalk_proxy.conf 内,而不是 nginx.conf.

但是,您仍然可以通过使用 .ebextension 配置创建文件 /etc/nginx/nginx.conf 来覆盖 nginx.conf,正如我在 this AWS Forum post

中的回复中所发现的那样