【问题标题】:cannot serve static files using caddy + django + gunicorn无法使用 caddy + django + gunicorn 提供静态文件
【发布时间】:2021-06-03 00:44:18
【问题描述】:

我正在开发一个项目,它使用 caddy 作为 Web 服务器和代理,django 作为后端,gunicorn 作为 wsgi。 但除了我无法提供静态文件之外,一切都运行良好。

这是我的球童档案。

mydomain.com {
    root * /path/to/staticfile/
    file_server
    encode zstd gzip
    @notstatic {
        not path /path/to/staticfile/*
    }
    reverse_proxy @notstatic app:8000
}

我用的有什么问题吗?

【问题讨论】:

    标签: django gunicorn static-files caddy


    【解决方案1】:

    如何摆脱@notstatic,即:

    mydomain.com {
        root * /path/to/staticfile/
        file_server
        encode zstd gzip
        reverse_proxy app:8000
    }
    

    【讨论】:

      猜你喜欢
      • 2013-06-27
      • 2021-07-18
      • 2015-11-30
      • 2012-09-29
      • 2023-03-05
      • 2017-05-31
      • 2016-10-13
      • 2022-11-10
      • 2012-12-06
      相关资源
      最近更新 更多