【问题标题】:Some routes are not working after closing terminal window, gunicorn, flask, ec2, aws关闭终端窗口、gunicorn、flask、ec2、aws 后,某些路由无法正常工作
【发布时间】:2021-07-27 05:19:14
【问题描述】:

我的烧瓶应用程序在带有 nginx 和 gunicorn3 的 ec2 实例上运行。我遇到的问题如下。 当我通过 SSH 连接到 EC2 机器并启动 Gunicorn 服务器gunicorn3 app:app 时,所有路由都可以正常工作,然后我就可以使用了。但是,在我关闭终端窗口后,只有少数路线有效,其他路线无效。 (在 20 条路线中,只有 3-4 条有效)。我正在使用 MongoDB 数据库,但这不是问题,因为一些具有 MongoDB 代码的路由工作得非常好,而其他也有 MongoDB 代码的路由却没有。

任何帮助都会很棒。

谢谢

【问题讨论】:

    标签: nginx flask amazon-ec2 gunicorn nginx-reverse-proxy


    【解决方案1】:

    检查问题的最佳方法是检查日志,确保您已在 nginx 和 gunicorn 中启用日志,您将能够回溯幕后发生的事情。还要确保通过主管运行 gunicorn,在任何情况下,如果进程被杀死,它将自动重启。

    参考:

    【讨论】:

      【解决方案2】:

      答案是在运行gunicorn3 app:app时添加-daemeon。所以完整的命令是gunicorn3 app:app --daemeon

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2013-04-21
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2020-06-26
        • 1970-01-01
        相关资源
        最近更新 更多