如何增加 Elastic Beanstalk 部署应用的 Nginx 超时?



我有一个flask应用程序,我正在使用弹性豆茎进行部署。在我的env.yaml中,我有:

...
aws:autoscaling:updatepolicy:rollingupdate:
RollingUpdateType: Health
Timeout: PT30M
...
aws:elasticbeanstalk:command:
BatchSize: "30"
BatchSizeType: Percentage
Timeout: 2000

但是当我的应用程序启动(带有application.py(时,我收到一个错误:

[CRITICAL] WORKER TIMEOUT (pid:11232)
[11232] [INFO] Worker exiting (pid: 11232)
[11324] [INFO] Booting worker with pid: 11324

如何增加超时?我尝试使用以下命令设置01.nginx.timeout.config

files:
"/etc/nginx/conf.d/01.nginx.timeout.conf":
mode: "000644"
owner: root
group: root
content: |
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"

但这给出了一个关于ngnix reload失败的错误。

我能做什么?

根据注释,解决方案是使用:

sudo systemctl restart nginx

代替

sudo service nginx reload

最新更新