aws beanstalk nodejs:如何覆盖 nginx 的 60 秒超时

use*_*686 5 nginx amazon-web-services node.js amazon-elastic-beanstalk

我想增加AWS弹性beanstalk中nodejs环境中nginx的默认超时,我正在遵循本指南:https://medium.com/swlh/using-ebextensions-to-extend-nginx-default-configuration- in-aws-elastic-beanstalk-189b844ab6ad但它不起作用,如果我上传我的应用程序,我会收到此错误在实例 id\'i-xxxxxxxxxx\' 上执行命令失败。中止操作。有什么建议吗?\ni\m 正在尝试使用 .ebextension,这是我的 01-timeout.config 文件的代码

\n
files:\n"/etc/nginx/conf.d/01-timeout.conf":\n mode: \xe2\x80\x9c000644\xe2\x80\x9d\n owner: root\n group: root\n content: |\n   keepalive_timeout 600s;\n   proxy_connect_timeout 600s;\n   proxy_send_timeout 600s; \n   proxy_read_timeout 600s; \n   fastcgi_send_timeout 600s; \n   fastcgi_read_timeout 600s;\ncontainer_commands:\n  nginx_reload:\n   command: "sudo service nginx reload"\n
Run Code Online (Sandbox Code Playgroud)\n

谢谢你的帮助。

\n

现在更新部署就可以了,但是超时不起作用,就像以前一样,超时为60秒,阅读日志似乎是重新加载了nginx,这是消息:命令 nginx_reload 成功,有什么问题的线索吗?

\n

Jij*_*tus 8

.ebextension 方法现在不起作用。请尝试.platform该方法。

请在您的项目根文件夹中创建一个名为的文件夹.platform

.platform/
         nginx/
              conf.d/
                    timeout.conf
         00_myconf.config
Run Code Online (Sandbox Code Playgroud)

文件 1 的内容 - timeout.conf.platform/nginx/conf.d/文件夹内)

keepalive_timeout 600s;
proxy_connect_timeout 600s;
proxy_send_timeout 600s; 
proxy_read_timeout 600s; 
fastcgi_send_timeout 600s; 
fastcgi_read_timeout 600s;
Run Code Online (Sandbox Code Playgroud)

文件 2 的内容 - 00_myconf.config.platform/文件夹内)

container_commands:
  01_reload_nginx:
    command: "service nginx reload"
Run Code Online (Sandbox Code Playgroud)

重新上传您的应用程序并查看更改。