我已经根据this article向我的Elastic Beanstalk环境nginx配置提供了。我的应用程序位于Docker容器中。问题在于环境无法重新加载nginx。
这是我的配置文件:
files:
"/etc/nginx/conf.d/proxy.conf" :
mode: "000644"
owner: root
group: root
content: |
client_max_body_size 500M;
container_commands:
01_reload_nginx:
command: "sudo service nginx reload"
这会导致失败(在/var/log/eb-activity.log
之后):
EmbeddedPostBuild/postbuild_0_audio_explorer] : Starting activity...
[2019-03-04T21:45:01.064Z] INFO [3274] - [Application deployment app-8a62-190304_223307@1/StartupStage0/EbExtensionPostBuild/Infra-EmbeddedPostBuild/postbuild_0_audio_explorer/Command 01_reload_nginx] : Starting activity...
[2019-03-04T21:45:01.100Z] INFO [3274] - [Application deployment app-8a62-190304_223307@1/StartupStage0/EbExtensionPostBuild/Infra-EmbeddedPostBuild/postbuild_0_audio_explorer/Command 01_reload_nginx] : Activity execution failed, because: (ElasticBeanstalk::ExternalInvocationError)
[2019-03-04T21:45:01.100Z] INFO [3274] - [Application deployment app-8a62-190304_223307@1/StartupStage0/EbExtensionPostBuild/Infra-EmbeddedPostBuild/postbuild_0_audio_explorer/Command 01_reload_nginx] : Activity failed.
[2019-03-04T21:45:01.100Z] INFO [3274] - [Application deployment app-8a62-190304_223307@1/StartupStage0/EbExtensionPostBuild/Infra-EmbeddedPostBuild/postbuild_0_audio_explorer] : Activity failed.
[2019-03-04T21:45:01.100Z] INFO [3274] - [Application deployment app-8a62-190304_223307@1/StartupStage0/EbExtensionPostBuild/Infra-EmbeddedPostBuild] : Activity failed.
[2019-03-04T21:45:01.122Z] INFO [3274] - [Application deployment app-8a62-190304_223307@1/StartupStage0/EbExtensionPostBuild] : Activity failed.
[2019-03-04T21:45:01.122Z] INFO [3274] - [Application deployment app-8a62-190304_223307@1/StartupStage0] : Activity failed.
[2019-03-04T21:45:01.122Z] INFO [3274] - [Application deployment app-8a62-190304_223307@1] : Completed activity. Result:
Application deployment - Command CMD-Startup failed
当我删除部分时:
container_commands:
01_reload_nginx:
command: "sudo service nginx reload"
部署顺利进行。
有什么想法吗?如何获得有关该命令究竟出了什么问题的信息?如果我使用ssh实例,则可以毫无问题地执行命令。
答案 0 :(得分:1)
弹性beantalk部署过程将为您重新加载nginx,因此您可以将其从脚本中永久删除并避免错误。弄清楚为什么命令确切失败的原因只是学术上的