wordpress-nginx/global/server/static-files.conf
2017-11-26 16:36:17 +00:00

40 lines
945 B
Plaintext

# Don't cache appcache, document html and data.
location ~* \.(?:manifest|appcache|html?|xml|json)$ {
add_header Cache-Control "max-age=0";
}
# Cache RSS and Atom feeds.
location ~* \.(?:rss|atom)$ {
add_header Cache-Control "max-age=3600";
}
# Caches images, icons, video, audio, HTC, etc.
location ~* \.(?:jpg|jpeg|gif|png|ico|cur|gz|svg|mp4|ogg|ogv|webm|htc)$ {
add_header Cache-Control "max-age=31536000";
access_log off;
}
# Cache svgz files, but don't compress them.
location ~* \.svgz$ {
add_header Cache-Control "max-age=31536000";
access_log off;
gzip off;
}
# Cache CSS and JavaScript.
location ~* \.(?:css|js)$ {
add_header Cache-Control "max-age=31536000";
access_log off;
}
# Cache WebFonts.
location ~* \.(?:ttf|ttc|otf|eot|woff|woff2)$ {
add_header Cache-Control "max-age=31536000";
access_log off;
}
# Don't record access/error logs for robots.txt.
location = /robots.txt {
access_log off;
log_not_found off;
}