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.
I have an AWS environment and I'm trying to override the nginx.conf that is used.
根据他们的文档,这可以通过在 .ebextensions/nginx/nginx.conf
要完全覆盖 Elastic Beanstalk 的默认 nginx 配置,请在源包中的 .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/
配置文件,它正在按预期创建一个文件.
I've done that to no avail. I've tried creating an entirely new application environment to ensure it's not due to the instance not fully restarting, but the original nginx.conf
is still being used. I have one other .ebextensions/
configuration file, and it is creating a file as expected.
关于为什么我的 nginx.conf
没有使用的任何线索?我可以提供的任何细节可能会提供一些见解?我在 eb-activity.log
中搜索错误,但没有看到任何错误.它确实说它膨胀
.ebextensions/nginx/
目录和created
.ebextensions/nginx/nginx.conf
文件在日志中,它对源包中的其余文件/目录执行此操作.不过,它并没有表明它试图使用我的 nginx.conf.
Any clues as to why my nginx.conf
isn't taking? Any details I could provide that might grant some insight? I searched for errors within eb-activity.log
but did not see any. It did say that it inflated
the .ebextensions/nginx/
directory and created
the .ebextensions/nginx/nginx.conf
file in the logs where it does so for the rest of the files / directories in your source bundle. Nowhere does it indicate that it tried to use my nginx.conf, though.
推荐答案
我正在查看的文档是专门针对 java 环境的.该方法适用于其他几种环境,但节点环境启动过程不同,会忽略该文件.我想这是因为服务器指令在 00_elastic_beanstalk_proxy.conf
内,而不是 nginx.conf
.
The documentation I was looking at was specifically for the java environment. The method works for several other environments, but the node environment startup process is different and ignores that file. I imagine it's because the server directive is within 00_elastic_beanstalk_proxy.conf
, rather than nginx.conf
.
但是,您仍然可以通过使用 .ebextension 配置来覆盖 nginx.conf
来创建文件 /etc/nginx/nginx.conf
正如我从这篇 AWS 论坛帖子
However, you can still override the nginx.conf
by instead using an .ebextension config to create the file /etc/nginx/nginx.conf
as I found from the reply in this AWS Forum post
这篇关于AWS Elastic Beanstalk .ebestensions/nginx/nginx.conf 不覆盖 AWS 的默认 nginx.conf的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!