Nginx to set the Expires HTTP header and the max-age directive of the Cache-Control HTTP header of static files
Add the following rules to your nginx configuration
# images, icons, video, audio, css, js
location ~* \.(?:jpg|jpeg|gif|png|ico|cur|gz|svg|svgz|mp4|ogg|ogv|webm|htc|css|js)$ {
expires 1M;
access_log off;
add_header Cache-Control "public";
}