【问题标题】:Nginx cache file by mime type按 mime 类型的 Nginx 缓存文件
【发布时间】:2011-09-06 22:17:29
【问题描述】:

我使用 nginx 作为前端,apache 作为后端。我需要缓存图片,但默认情况下 nginx 是通过扩展缓存文件。 Apache 从 db 中获取图片并在没有扩展的情况下发送。 nginx可以按mime类型缓存文件吗?

【问题讨论】:

    标签: apache caching nginx mime-types frontend


    【解决方案1】:

    你需要这样的东西。

    if ($upstream_http_content_type ~* "image/") {
        DEFINE_YOUR_CACHE_SETTINGS
    }
    

    【讨论】:

      猜你喜欢
      • 2014-04-18
      • 2011-11-16
      • 2014-03-14
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-02-25
      • 2018-06-27
      • 2019-01-28
      相关资源
      最近更新 更多