Send browser cache headers by mime type


« Back to overview

outside the server block:
map $sent_http_content_type $expires {
    default                    off;
    text/css                   max;
    application/javascript     max;
    ~image/                    max;
    application/font-woff      max;
    application/font-woff2     max;
    application/font-ttf      max;
}
inside the Nginx server block:
expires $expires;