AWS beantalk Node.js:如何覆盖Nginx的60秒超时 [英] aws beanstalk nodejs: how to override 60s timeout of nginx
问题描述
我想在AWS Elastic beantalk的nodejs环境中增加Nginx的默认超时,我正在遵循此指南:
I want to increase the default timeout of nginx in a nodejs environment in AWS elastic beanstalk, i'm following this guide: https://medium.com/swlh/using-ebextensions-to-extend-nginx-default-configuration-in-aws-elastic-beanstalk-189b844ab6ad but it's not working, if i upload my application i receive this error Unsuccessful command execution on instance id(s) 'i-xxxxxxxxxx'. Aborting the operation. any suggestion? i'm trying to use .ebextension and this is the code of my 01-timeout.config file
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成功,任何提示是什么问题?
Update now the deploy it's ok, but the timeout doesn't work, it's like before with the timeout of 60s, reading the logs seems that the reload of nginx it's made, this is the message: Command nginx_reload succeeded , any clue of what is the problem?
推荐答案
.ebextension方法现在不起作用.请尝试使用 .platform
方法.
.ebextension method is not working now.Please try .platform
method.
请在您的项目根文件夹中创建一个名为 .platform
的文件夹.
Please create a folder called .platform
in your project root folder.
.platform/
nginx/
conf.d/
timeout.conf
00_myconf.config
文件1的内容- timeout.conf
(在 .platform/nginx/conf.d/
文件夹内部)
Content of File 1 - timeout.conf
(Inside .platform/nginx/conf.d/
folder)
keepalive_timeout 600s;
proxy_connect_timeout 600s;
proxy_send_timeout 600s;
proxy_read_timeout 600s;
fastcgi_send_timeout 600s;
fastcgi_read_timeout 600s;
文件2的内容- 00_myconf.config
(在 .platform/
文件夹内部)
Content of File 2 - 00_myconf.config
(Inside .platform/
folder)
container_commands:
01_reload_nginx:
command: "service nginx reload"
重新上传您的应用程序并查看更改.
reupload your application and see the changes.
这篇关于AWS beantalk Node.js:如何覆盖Nginx的60秒超时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!