【发布时间】:2020-12-19 15:52:28
【问题描述】:
我想在 AWS elastic beanstalk 的 nodejs 环境中增加 nginx 的默认超时,我正在遵循本指南:https://medium.com/swlh/using-ebextensions-to-extend-nginx-default-configuration-in-aws-elastic-beanstalk-189b844ab6ad 但它不起作用,如果我上传我的应用程序我收到此错误 Unsuccessful command execution on instance id(s) 'i-xxxxxxxxxxxx'。中止操作。有什么建议吗? 我正在尝试使用 .ebextension,这是我的 01-timeout.config 文件的代码
files:
"/etc/nginx/conf.d/01-timeout.conf":
mode: “000644”
owner: root
group: root
content: |
keepalive_timeout 600s;
proxy_connect_timeout 600s;
proxy_send_timeout 600s;
proxy_read_timeout 600s;
fastcgi_send_timeout 600s;
fastcgi_read_timeout 600s;
container_commands:
nginx_reload:
command: "sudo service nginx reload"
感谢您的帮助。
更新现在部署没问题,但是超时不起作用,就像之前的60s超时一样,阅读日志似乎是nginx的重新加载,这是消息: 命令 nginx_reload 成功,有什么问题的线索吗?
【问题讨论】:
-
检查你的弹性beantalk日志,你可能会发现命令失败的原因,或者
nginx_reload之前可能缺少一个空格但不确定。 -
你是对的,我发现了这个错误:2020/08/31 13:19:40 [emerg] 18127#0: unknown directive "files:" in /var/proxy/staging/nginx/ conf.d/01-timeout.conf:7 但我该如何解决呢?
-
可能是缩进,尝试将
files:内容缩进两个空格,同时缩进/etc/nginx....下的所有内容,除了container_commands
标签: node.js amazon-web-services nginx amazon-elastic-beanstalk