http
ディレクティブに map
ディレクティブを追加
nginx.conf
map $sent_http_content_type $expires {
default off;
~image/ max;
~audio/ max;
~video/ max;
text/css 30d;
text/javascript 30d;
application/javascript 30d;
application/pdf max;
}
mime タイプは正規表現でも書ける。
server
ディレクティブに以下を追加
nginx/conf.d/server.conf
server {
expires $expires;
# :
}
これで安心