【问题标题】:How do I increase the Nginx timeout for an Elastic Beanstalk deployed app?如何增加 Elastic Beanstalk 部署的应用程序的 Nginx 超时?
【发布时间】:2020-10-25 23:00:20
【问题描述】:

我有一个flask 应用程序,我正在使用弹性beantalk 进行部署。在我的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吗?
  • 是的 - 做到了。如果您作为答案发布,我可以接受。
  • 谢谢,很高兴听到。添加答案:-)

标签: amazon-web-services nginx amazon-elastic-beanstalk


【解决方案1】:

基于 cmets,解决方案是使用:

sudo systemctl restart nginx

代替

sudo service nginx reload

【讨论】:

    猜你喜欢
    • 2013-04-03
    • 1970-01-01
    • 2020-09-29
    • 2015-04-13
    • 2017-07-09
    • 2017-03-04
    • 2021-04-28
    • 2016-11-20
    • 2015-09-21
    相关资源
    最近更新 更多