ElasticBeanstalk with Amazing Linux 2 即使 Nginx 配置更新也会超时

ElasticBeanstalk with Amazing Linux 2 keeps timing out even with Nginx config updates

我使用 Amazing Linux 2 将 Flask 应用程序 (WSGI) 部署到 Elastic Beanstalk。在我的 /var/log/web.stdout.log 中,我有:

Jul 13 20:47:34 ip-172-31-11-53 web: [2020-07-13 20:47:34 +0000] [1531] [INFO] Worker exiting (pid: 1531)
Jul 13 20:47:34 ip-172-31-11-53 web: Loading generator
Jul 13 20:47:34 ip-172-31-11-53 web: cache_dir /tmp/downloads/models
Jul 13 20:47:34 ip-172-31-11-53 web: using device: cpu
Jul 13 20:47:35 ip-172-31-11-53 web: [2020-07-13 20:47:35 +0000] [1576] [INFO] Booting worker with pid: 1576
Jul 13 20:47:39 ip-172-31-11-53 web: Some weights of GPT2LMHeadModel were not initialized from the model checkpoint at distilgpt2 and are newly initialized: ['transformer.h.0.attn.masked_bias', 'transformer.h.1.attn.masked_bias', 'transformer.h.2.attn.masked_bias', 'transformer.h.3.attn.masked_bias', 'transformer.h.4.attn.masked_bias', 'transformer.h.5.attn.masked_bias']
Jul 13 20:47:39 ip-172-31-11-53 web: You should probably TRAIN this model on a down-stream task to be able to use it for predictions and inference.
Jul 13 20:48:05 ip-172-31-11-53 web: [2020-07-13 20:48:05 +0000] [3858] [CRITICAL] WORKER TIMEOUT (pid:1576)
Jul 13 20:48:05 ip-172-31-11-53 web: [2020-07-13 20:48:05 +0000] [1576] [INFO] Worker exiting (pid: 1576)

表示 20 秒超时。但是,在 .platform/hooks/nginx/conf.d/timeout.conf 中,我有:

proxy_connect_timeout 600s;
proxy_send_timeout 600s; 
proxy_read_timeout 600s; 
fastcgi_send_timeout 600s; 
fastcgi_read_timeout 600s;

这应该有 600 秒的超时时间,但遗憾的是 - 没有。我做错了什么?

timeout.conf 应该在:

.platform/nginx/conf.d/timeout.conf

如文档所述here

但是您在 hooks 文件夹中有它:

.platform/hooks/nginx/conf.d/timeout.conf

这可以解释为什么它们未应用。可能还有其他原因,但错误的文件夹是目前明显的原因之一。