solar
solar

Reputation: 29

Nginx cache file by mime type

I use nginx as frontend, apache as backend. I need cache pictures, but by default nginx is caching file by extentions. Apache takes pictures from db and send it without extentions. Can nginx cache files by mime type and how?

Upvotes: 1

Views: 1598

Answers (1)

Timofey Stolbov
Timofey Stolbov

Reputation: 4621

You need something like this.

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

Upvotes: 1

Related Questions