小编pra*_*tik的帖子

Gunicorn + Nginx - 连接到上游时资源暂时不可用

我们正在使用 Gunicorn + Supervisor + nginx 在 beanstalk 上使用 docker 环境运行 django 应用程序

问题是主管显示 Gunicorn 已启动,但所有请求均失败,并显示来自 nginx 的 502 响应代码。即使实例上没有流量,Gunicorn 进程也不会恢复。

理想情况下,我认为主管应该重新启动 Gunicorn 进程,因为它无法成功响应任何请求。

负载:每分钟/实例约 1700 个请求 - c6a.large 实例

server_tokens off;

upstream wsgi_server {
  # fail_timeout=0 means we always retry an upstream even if it failed
  # to return a good HTTP response (in case the Unicorn master nukes a
  # single worker for timing out).

  server unix:/run/django_app.sock fail_timeout=0;
}

server {
  location / {
      proxy_set_header Host $http_host;
      proxy_set_header …
Run Code Online (Sandbox Code Playgroud)

django nginx supervisord gunicorn amazon-elastic-beanstalk

5
推荐指数
0
解决办法
237
查看次数