【问题标题】:Segmentation fault (core dumped) when using NGINX Reverse proxy. Flask使用 NGINX 反向代理时出现分段错误(核心转储)。烧瓶
【发布时间】:2020-10-05 18:35:52
【问题描述】:

我正在使用这个烧瓶分析器

https://github.com/muatik/flask-profiler

在本地,它可以与一个简单的烧瓶应用程序一起正常工作,但是,当我在使用 NGINX 作为反向代理的服务器上运行它时,它会工作几分钟然后返回

Segmentation fault (core dumped)

我使用的是默认配置

    # You need to declare necessary configuration to initialize
# flask-profiler as follows:
app.config["flask_profiler"] = {
    "enabled": app.config["DEBUG"],
    "storage": {
        "engine": "sqlite"
    },
    "basicAuth":{
        "enabled": True,
        "username": "admin",
        "password": "admin"
    },
    "ignore": [
        "^/static/.*"
    ]
}

我 90% 确定这是由反向代理引起的,因为这是唯一发生变化的事情。我找到了这个https://github.com/muatik/flask-profiler/issues/65,但即使设置了正确的路径也没有运气。

【问题讨论】:

    标签: python nginx flask


    【解决方案1】:

    我能够通过将以下内容添加到我的 NGINX 规则来解决问题

           proxy_set_header X-Real-IP $remote_addr;
    

    【讨论】:

      猜你喜欢
      • 2016-10-23
      • 1970-01-01
      • 2021-03-17
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-09-11
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多