【问题标题】:502 Bad Gateway django nginx + gunicorn502 Bad Gateway django nginx + gunicorn
【发布时间】:2023-03-20 17:23:01
【问题描述】:

我正在使用 post 请求将大量数据从用户输入(textarea)加载到数据库(18k lines) 我得到了502 Bad Gateway 错误

当我打印sudo nano /var/log/nginx/error.log 我明白了:

2018/09/06 10:21:04 [alert] 19688#19688: *3 open socket #22 left in connection 4
2018/09/06 10:21:04 [alert] 19688#19688: aborting
2018/09/06 11:04:32 [error] 20076#20076: *14 upstream prematurely closed connection while reading response header from upstream, client: 95.1$

这仅在我的生产服务器(nginx + gunicorn + postgres)上,在我的开发服务器上效果很好。

我该怎么办?

我也有

【问题讨论】:

  • 你的 gunicorn 日志是怎么说的?

标签: django nginx gunicorn


【解决方案1】:

增加 gunicorn 的超时时间有助于解决问题

【讨论】:

    猜你喜欢
    • 2016-04-20
    • 2016-01-04
    • 2014-04-30
    • 2016-03-26
    • 2019-01-22
    • 2020-09-01
    • 2020-06-12
    • 2018-08-03
    • 1970-01-01
    相关资源
    最近更新 更多